timers: backport f8193ab
authorJulien Gilli <julien.gilli@joyent.com>
Wed, 23 Jul 2014 01:03:10 +0000 (18:03 -0700)
committerTimothy J Fontaine <tjfontaine@gmail.com>
Thu, 31 Jul 2014 15:53:24 +0000 (08:53 -0700)
commitbefbbad0513c5f1075c573570a678d148b645a82
tree855d2c9ddb23be3843f92bceb9098156e0d18398
parent9f36c0d235f4eb7e6528face49c15045a5e41e14
timers: backport f8193ab

Original commit message:

 timers: use uv_now instead of Date.now

 This saves a few calls to gettimeofday which can be expensive, and
 potentially subject to clock drift. Instead use the loop time which
 uses hrtime internally.

In addition to the backport, this commit:
 - keeps _idleStart timers' property which is still set to
   Date.now() to avoid breaking existing code that uses it, even if
   its use is discouraged.
 - adds automated tests. These tests use a specific branch of
   libfaketime that hasn't been submitted upstream yet. libfaketime
   is git cloned if needed when running automated tests.

Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
.gitignore
Makefile
lib/timers.js
lib/tls.js
src/timer_wrap.cc
test/common.js
test/timers/test-timers-reliability.js [new file with mode: 0644]
test/timers/testcfg.py [new file with mode: 0644]
tools/Makefile [new file with mode: 0644]