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.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="time-progress"></div>
<div id="time-remaining"></div>
duration = 5000;
function digitize(n) {
return n > 9 ? "" + n : "0" + n;
}
function secondsToHMS(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;
}
timeProgress_58549 = $("#time-progress");
timeRemaining_58549 = $("#time-remaining");
function processTime_58549(currentTime) {
var value = (100 / duration) * currentTime;
var progressHMS = secondsToHMS(currentTime);
var remainingHMS = "-" + secondsToHMS(duration - currentTime);
timeProgress_58549.html(progressHMS);
timeRemaining_58549.html(remainingHMS);
}
var timeProgress_58562 = document.createTextNode("");
document.getElementById('time-progress').appendChild(timeProgress_58562);
var timeRemaining_58562 = document.createTextNode("");
document.getElementById('time-progress').appendChild(timeRemaining_58562);
function processTime_58562(currentTime) {
var value = (100 / duration) * currentTime;
var progressHMS = secondsToHMS(currentTime);
var remainingHMS = "-" + secondsToHMS(duration - currentTime);
timeProgress_58562.data = progressHMS;
timeRemaining_58562.data = progressHMS;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
OP |
| ready |
Dagg |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.