1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

timer: due/now Math.max instead of min (#3477)

This commit is contained in:
Kevin (Kun) "Kassimo" Qian 2019-12-10 03:21:30 -08:00 committed by Bert Belder
parent 4b9953b6ac
commit ec7f3ce1c2

View file

@ -192,7 +192,7 @@ function firePendingTimers(): void {
pendingScheduleTimers = [];
// Reschedule for next round of timeout.
const nextDueNode = dueTree.min();
const due = nextDueNode && Math.min(nextDueNode.due, now);
const due = nextDueNode && Math.max(nextDueNode.due, now);
setOrClearGlobalTimeout(due, now);
} else {
// Fire a single timer and allow its children microtasks scheduled first.