jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
Benchmarks for Efficiency of this constantly running time processor for an HTML5 video control bar, a question on Code Review Stack Exchange.
function digitize(n) {
return n > 9 ? "" + n : "0" + n;
}
function secondsToHMS_58549(seconds) {
var numhours = digitize(Math.floor(((seconds % 31536000) % 86400) / 3600));
var numminutes = digitize(Math.floor((((seconds % 31536000) % 86400) % 3600) / 60));
var numseconds = digitize(Math.floor((((seconds % 31536000) % 86400) % 3600) % 60));
return numhours + ":" + numminutes + ":" + numseconds;
}
function secondsToHMS_58551(intime) {
var numseconds = digitize(intime % 60);
intime = Math.floor(intime / 60);
var numminutes = digitize(intime % 60);
intime = Math.floor(intime / 60);
var numhours = digitize(intime);
return numhours + ":" + numminutes + ":" + numseconds;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
OP |
| ready |
rolfl |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.