mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 21:46:48 +00:00

Hang all timer lists off a single TimerWrap and use the PriorityQueue to manage expiration priorities. This makes the Timers code clearer, consumes significantly less resources and improves performance. PR-URL: https://github.com/nodejs/node/pull/20555 Fixes: https://github.com/nodejs/node/issues/16105 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
13 lines
317 B
JavaScript
13 lines
317 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
// This isn't officially supported but nonetheless is something that is
|
|
// currently possible and as such it shouldn't cause the process to crash
|
|
|
|
const t = setTimeout(common.mustCall(() => {
|
|
if (t._repeat) {
|
|
clearInterval(t);
|
|
}
|
|
t._repeat = 1;
|
|
}, 2), 1);
|