div test

JavaScript performance comparison

Test case created by gfsd

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
div 1
Number.prototype.div = function (n) {
  return (this - this % n - (this < 0 ? n : 0)) / n;
}

for (var i = 0; i < 1000000; i++) {
  var j = i.div(14523);
}
pending…
div 2
Number.prototype.div = function (n) {
  return parseInt(this / n);
}

for (var i = 0; i < 1000000; i++) {
  var j = i.div(14523);
}
pending…

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

Compare results of other browsers

0 comments

Add a comment