js optimization

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
t1
function benchmark(testId){

  var startTime = 0;
  var endTime = 0;
  var testName = '';
  var timeDiv = 0;

  if(testId == 1){
    testName = "Test 1";
    startTime = new Date().getTime();
    var i = 1+50*77;
    endTime = new Date().getTime();
  }else{
    testName = "Test 2";
    startTime = new Date().getTime();
    var i = 1+100*67;
    endTime = new Date().getTime();
  }

  timeDiv = endTime - startTime;

  alert('Der Test '+ testName +' benötigte: '+ timeDiv +' ms');
}
benchmark(1);
ready
t2
function benchmark(c){var e=0;var b=0;var a="";var f=0;if(c==1){a="Test 1";e=new Date().getTime();var d=1+100;b=new Date().getTime()}else{a="Test 2";e=new Date().getTime();var d=1+100;b=new Date().getTime()}f=b-e;alert("Der Test "+a+" benötigte: "+f+" ms")};
benchmark(2);
ready
t3
var _0x130d=["","\x54\x65\x73\x74\x20\x31","\x67\x65\x74\x54\x69\x6D\x65","\x54\x65\x73\x74\x20\x32","\x44\x65\x72\x20\x54\x65\x73\x74\x20","\x20\x62\x65\x6E\xF6\x74\x69\x67\x74\x65\x3A\x20","\x20\x6D\x73"];function benchmark(_0x5d86x2){var _0x5d86x3=0;var _0x5d86x4=0;var _0x5d86x5=_0x130d[0];var _0x5d86x6=0;if(_0x5d86x2==1){_0x5d86x5=_0x130d[1];_0x5d86x3= new Date()[_0x130d[2]]();var _0x5d86x7=1+100;_0x5d86x4= new Date()[_0x130d[2]]();} else {_0x5d86x5=_0x130d[3];_0x5d86x3= new Date()[_0x130d[2]]();var _0x5d86x7=1+100;_0x5d86x4= new Date()[_0x130d[2]]();} ;_0x5d86x6=_0x5d86x4-_0x5d86x3;alert(_0x130d[4]+_0x5d86x5+_0x130d[5]+_0x5d86x6+_0x130d[6]);} ;
benchmark(2);
ready

Revisions

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