JavaScript bitwise NOT vs Math.floor() (v32)

Revision 32 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor()
var test;
for (var i = 0; i < 100000; i++) {
  test = ~i;
}
ready
bitwise NOT
var test;
for (var i = 0; i < 100000; i++) {
  test = i + 1;
}
ready

Revisions

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