mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 16:34:05 +01:00
befbbad051
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>
21 lines
510 B
Makefile
21 lines
510 B
Makefile
FAKETIME_REPO := git://github.com/wolfcw/libfaketime.git
|
|
FAKETIME_LOCAL_REPO := $(CURDIR)/faketime
|
|
FAKETIME_BRANCH := master
|
|
FAKETIME_BINARY := $(FAKETIME_PREFIX)/bin/faketime
|
|
|
|
.PHONY: faketime
|
|
|
|
faketime: $(FAKETIME_BINARY)
|
|
|
|
clean:
|
|
$(RM) -r $(FAKETIME_LOCAL_REPO)
|
|
|
|
$(FAKETIME_BINARY): $(FAKETIME_LOCAL_REPO)
|
|
cd $(FAKETIME_LOCAL_REPO) && \
|
|
git checkout $(FAKETIME_BRANCH) && \
|
|
PREFIX=$(FAKETIME_LOCAL_REPO)/src make
|
|
|
|
$(FAKETIME_LOCAL_REPO):
|
|
git clone $(FAKETIME_REPO) $(FAKETIME_LOCAL_REPO)
|
|
|