Math.floor vs Math.round vs parseInt vs Bitwise (v116)

Revision 116 of this benchmark created on


Description

Rounding in all form possible

Setup

var u = Date.now() / 1000;
    var f = Math.floor;
    var r = Math.round;

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
f(u);
ready
Math.round
r(u);
ready
Bitwise |
u | 0;
ready
Bitwise >>
u >> 0;
ready
Bitwise ~~
~~u;
ready
Bitwise <<
u << 0;
ready
Bitwise >>>
u >>> 0;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.