timeoutSort
timeoutSort

1 crossposts
timeoutSort

You're viewing a single thread.
Wait till you find out how the runtime manages multiple concurrent timers
it's
undefined
while (true) {
let t = Date.now();
if (timeoutMap.has(t)) timeoutMap[t]();
}
of course. Clearly O(n).
I found a way to optimize your code without affecting the result. By making it branchless, I was able to get my CPU to 100% utilization!
Then don't complain once you get arrested...
From nowaday's standards, that's express warranty that lasts until you start executing your code.