get time vs unary plus (v9)

Revision 9 of this benchmark created by Luke Bonaccorsi on


Setup

var now = new Date();

Test runner

Ready to run.

Testing in
TestOps/sec
getTime
var t = now.getTime();
ready
unary plus
var t = +now;
ready
getTime on new Date()
var t = (new Date()).getTime();
ready
unary + on new Date()
var t = +new Date();
ready
unary to string
var t = (+new Date).toString();
ready
to string
var t = (new Date).getTime()
ready
Date.now
var t = Date.now()
ready

Revisions

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