new Date().getTime() vs Date.now() (v23)

Revision 23 of this benchmark created on


Setup

var now = Date.now || function() {
        return new Date().getTime();
      }
    var legacy = function() {
      return new Date().getTime();
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Date.now
Date.now();
ready
+new Date()
+new Date();
ready
getTime()
new Date().getTime()
ready
new Date()-10
new Date()-0
ready

Revisions

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