you are viewing a single comment's thread
view the rest of the comments
[–] 18 points 1 year ago (4 children)

Wait till you find out how the runtime manages multiple concurrent timers

  • source
  • hideshow 4 child comments
  • [–] 12 points 1 year ago (3 children)

    it's

    while (true) {
        let t = Date.now();
        if (timeoutMap.has(t)) timeoutMap[t]();
    }
    

    of course. Clearly O(n).

    disclaimerFeel free to use it. I guarantee it is bug free. Comes with express warranty. This notice is legally binding.

  • source
  • parent
  • hideshow 3 child comments