Comparing 1

Benchmark created on


Setup

var a = Math.random()*100;
  var inRange;

Test runner

Ready to run.

Testing in
TestOps/sec
Regular compare
if( a > 0 && a < 512 ) {
  inRange = true;
}
ready
Binary operation
if( ~a & 512 ) {
  inRange = true;
}
ready

Revisions

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