Date.now() v new Date().getTime()

Benchmark created by Blake Embrey on


Description

Checking performance of the different ways to get the current unix timestamp.

Test runner

Ready to run.

Testing in
TestOps/sec
Date.now()
Date.now();
ready
new Date().getTime();
new Date().getTime();
ready
+new Date();
+new Date();
ready
Cross-browser
(Date.now || new Date().getTime)();
ready

Revisions

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

  • Revision 1: published by Blake Embrey on