Skip to content

Instantly share code, notes, and snippets.

@ovidiuch
Last active December 18, 2015 21:58
Show Gist options
  • Save ovidiuch/5850621 to your computer and use it in GitHub Desktop.
Save ovidiuch/5850621 to your computer and use it in GitHub Desktop.
Calculate percentages of loading time improvement
var times = [
// Dashboard
[12.50, 3.41],
// Settings
[12.04, 3.00],
// Mention Stream
[11.90, 3.07],
[11.90, 4.35],
// Signal Stream
[11.81, 2.53],
[11.81, 3.45]
]
var time, percent;
for (i in times) {
time = times[i];
percent = (time[0] - time[1]) / time[0] * 100;
console.log(percent.toFixed(2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment