Performance of Javascript timers (v5)

Revision 5 of this benchmark created by Jiayong Ou on


Setup

var perf = window.performance;
  function dateNow() {
      return Date.now();
  }
  function perfNow() {
      return perf.now();
  }
  var boundDateNow = Date.now.bind(Date);
  var boundPerfNow = perf.now.bind(perf);
  var unboundDateNow = Date.now;

Teardown



            var t1;
        
  

Test runner

Ready to run.

Testing in
TestOps/sec
performance.now()
t1 = perf.now();
ready
Date.now() function
t1 = dateNow();
ready
Date.now()
t1 = Date.now();
ready
bound Date.now()
t1 = boundDateNow();
ready
bound perf.now()
t1 = boundPerfNow();
ready
performance.now() function
t1 = perfNow();
ready
unbound Date.now()
t1 = unboundDateNow();
ready
perf.now();
t1 = perf.now();
ready

Revisions

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

  • Revision 1: published by Mateusz ★ on
  • Revision 2: published by iProDev on
  • Revision 3: published by Jiayong Ou on
  • Revision 4: published by Jiayong Ou on
  • Revision 5: published by Jiayong Ou on