New Date value

JavaScript performance comparison

Revision 3 of this test case created by Mathias Bynens

Preparation code

<script>
  // IE8 and below don’t support ES5 Date.now()
  if (!Date.now) {
   Date.now = function() {
    return +new Date();
   };
  };
</script>
    

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Using .valueOf()
new Date().valueOf();
pending…
Using .getTime()
new Date().getTime();
pending…
+new Date()
+new Date();
pending…
+new Date
+new Date;
pending…
Date.now()
Date.now();
pending…

Compare results of other browsers

Revisions

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

0 Comments