Math.abs

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Math.abs
Math.abs(Math.floor(Math.random() * 10000));
ready
bitwise
var x = Math.floor(Math.random() * 10000);
x < 0 ? x : -x;
ready

Revisions

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