• sus@programming.dev
    link
    fedilink
    arrow-up
    9
    ·
    7 hours ago

    it’s

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

    of course. Clearly O(n).

    disclaimer

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