integer division

Benchmark created by Sergii on


Test runner

Ready to run.

Testing in
TestOps/sec
parseInt
var a = 3;
for (var i = 0; i < 1000; i++) {
  parseInt(i / a);
}
ready
Math.Floor
var a = 3;
for (var i = 0; i < 1000; i++) {
  Math.floor(i / a);
}
ready
<< 0
var a = 3;
for (var i = 0; i < 1000; i++) {
  i / a << 0
}
ready
~~
var a = 3;
for (var i = 0; i < 1000; i++) {~~
  (i / a)
}
ready

Revisions

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

  • Revision 1: published by Sergii on