From 2930bd1317d15d12738a4896c0a6c05700411b47 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Sun, 13 May 2018 17:42:22 +0200 Subject: src: refactor timers to remove TimerWrap Refactor Timers to behave more similarly to Immediates by having a single uv_timer_t handle which is stored on the Environment. No longer expose timers in a public binding and instead make it part of the internalBinding. PR-URL: https://github.com/nodejs/node/pull/20894 Fixes: https://github.com/nodejs/node/issues/10154 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Matteo Collina Reviewed-By: Jeremiah Senkpiel Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Gus Caplan --- test/sequential/test-timers-blocking-callback.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/sequential/test-timers-blocking-callback.js') diff --git a/test/sequential/test-timers-blocking-callback.js b/test/sequential/test-timers-blocking-callback.js index 435b69d1fa..3d05a538ea 100644 --- a/test/sequential/test-timers-blocking-callback.js +++ b/test/sequential/test-timers-blocking-callback.js @@ -25,7 +25,6 @@ const common = require('../common'); const assert = require('assert'); -const Timer = process.binding('timer_wrap').Timer; const TIMEOUT = 100; @@ -49,7 +48,7 @@ function blockingCallback(retry, callback) { ++nbBlockingCallbackCalls; if (nbBlockingCallbackCalls > 1) { - latestDelay = Timer.now() - timeCallbackScheduled; + latestDelay = Date.now() - timeCallbackScheduled; // Even if timers can fire later than when they've been scheduled // to fire, they shouldn't generally be more than 100% late in this case. // But they are guaranteed to be at least 100ms late given the bug in @@ -68,7 +67,7 @@ function blockingCallback(retry, callback) { // block by busy-looping to trigger the issue common.busyLoop(TIMEOUT); - timeCallbackScheduled = Timer.now(); + timeCallbackScheduled = Date.now(); setTimeout(blockingCallback.bind(null, retry, callback), TIMEOUT); } } -- cgit v1.2.3