mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 13:11:36 +00:00

PR-URL: https://github.com/nodejs/node/pull/18161 Fixes: https://github.com/nodejs/node/issues/18160 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
18 lines
374 B
JavaScript
18 lines
374 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const Timer = process.binding('timer_wrap').Timer;
|
|
const assert = require('assert');
|
|
|
|
let cntr = 0;
|
|
let first;
|
|
const t = setInterval(() => {
|
|
cntr++;
|
|
if (cntr === 1) {
|
|
common.busyLoop(100);
|
|
first = Timer.now();
|
|
} else if (cntr === 2) {
|
|
assert(Timer.now() - first < 100);
|
|
clearInterval(t);
|
|
}
|
|
}, 100);
|