Methods of getting time (v15)

Revision 15 of this benchmark created on


Description

https://twitter.com/jaffathecake/status/306706682552143872

jaffathecake: Avoid "+new Date" to generate timestamps during animation. Use "Date.now()" or "performance.now()" instead http://t.co/Hle0qzxWeZ

Setup

var perf = performance,
    perfNow = window.performance.now;
    dateNow = Date.now;

Test runner

Ready to run.

Testing in
TestOps/sec
Date.now
Date.now();
ready
Cached Date.now
dateNow();
ready
new Date().getTime()
new Date().getTime();
ready
new Date().valueOf()
new Date().valueOf();
ready
Number(new Date)
Number(new Date);
ready
+new Date()
+new Date();
ready
performance.now()
performance.now();
ready
Cached performance object
perf.now();
ready
Cached performance.now method
perfNow();
ready
window.performance.now()
window.performance.now();
ready

Revisions

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