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
const HOUR_MS = 60 * 60 * 1000;
const d = new Date("2025-07-02T13:25:30.500Z").getTime();
function m1(timestamp) {
const startDate = new Date(timestamp);
startDate.setMinutes(0, 0, 0);
const startOfHour = startDate.getTime();
const endDate = new Date(timestamp);
endDate.setMinutes(59, 59, 999);
const endOfHour = endDate.getTime();
return { startOfHour, endOfHour };
}
function m2(timestamp) {
const startOfHour = Math.floor(timestamp / HOUR_MS) * HOUR_MS;
const endOfHour = startOfHour + HOUR_MS - 1;
return { startOfHour, endOfHour };
}
function m3(timestamp) {
const startOfHour = timestamp - (timestamp % HOUR_MS);
const endOfHour = startOfHour + HOUR_MS - 1;
return { startOfHour, endOfHour };
}
Ready to run.
| Test | Ops/sec | |
|---|---|---|
| t1 | | ready |
| t2 | | ready |
| t3 | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.