Quickest way to a UNIX Date (v21)

Revision 21 of this benchmark created on


Description

Pits ES5.1 Date.now() against backwards-compatible alternatives.

Preparation HTML

<script src="http://momentjs.com/downloads/moment.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Date.now() (ES5.1, IE9+)
Date.now()
ready
new Date().getTime() (All Browsers)
new Date().getTime()
ready
+new Date() (All Browsers)
+new Date()
ready
+new Date (All Browsers)
+new Date
ready
moment().valueOf()
moment().valueOf()
ready
+moment()
+moment()
ready

Revisions

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