Adding +-1'

Benchmark created on


Setup

var rand =  function(){
         var  r= Math.random()-0.5
         if(r <0) r = -1;
         else if(r>0) r = 1
        }
        var suma = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
just add
suma += rand();
ready
check before
var r = rand();
if(r>0) r++;
else if(r<0) r--
ready

Revisions

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