Floor vs Double Tilde

Benchmark created by Soulcyon on


Preparation HTML

<script>
  var t1 = 100.10, t2 = 100;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Math Floor
var r1 = Math.floor(t1);
var r2 = Math.floor(t2);
return r1 == r2;
ready
Double Tilde
var r1 = ~~t1;
var r2 = ~~t2;
return r1 == r2;
ready

Revisions

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

  • Revision 1: published by Soulcyon on