Performance of Javascript timers (v4)

Revision 4 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);

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 perf.now()
t1 = boundPerfNow();
ready
perf.now();
t1 = perf.now();
ready
bound Date.now()
t1 = boundDateNow();
ready
performance.now() function
t1 = perfNow();
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