cm0002@lemmy.world to Programmer Humor@programming.dev · 21 hours agotimeoutSortlemmy.mlimagemessage-square30fedilinkarrow-up1410arrow-down13
arrow-up1407arrow-down1imagetimeoutSortlemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 21 hours agomessage-square30fedilink
minus-squareNat (she/they)@lemmy.blahaj.zonelinkfedilinkarrow-up15·9 hours agoWait till you find out how the runtime manages multiple concurrent timers
minus-squaresus@programming.devlinkfedilinkarrow-up9·7 hours agoit’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.
minus-squareyetAnotherUser@lemmy.calinkfedilinkarrow-up1·6 hours agoThen don’t complain once you get arrested…
Wait till you find out how the runtime manages multiple concurrent timers
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.
Then don’t complain once you get arrested…