test_mef_123321

JavaScript performance comparison

Test case created by mef

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
js1
var getRandomHex = function() {
  var e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f"],
    t = Math.floor(Math.random() * 16);
  return e[t];
};

var getUuid = function() {
  var e = "";
  for (var t = 0; t < 40; t++) e += this.getRandomHex();
  return e
}

var e = getUuid();
console.log(e);
pending…
js2
var getRandomInt = function(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
var e = "";
for (var i = 0; i < 40; i++) {
  e += getRandomInt(0, 15).toString(16);
}
console.log(e);
pending…
sj3
var getRandomInt = function(min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
var e = "";
for (var i = 0; i < 40; i++) {
  e += getRandomInt(0, 15).toString(16);
}
console.log(e);
var getRandomHex = function() {
  var e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f"],
    t = Math.floor(Math.random() * 16);
  return e[t];
};

var getUuid = function() {
  var e = "";
  for (var t = 0; t < 40; t++) e += this.getRandomHex();
  return e
}

var e = getUuid();
console.log(e);
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