Hopding / js-visualizer-9000-client

A React app to interactively visualize JavaScript's Event Loop
https://jsv9000.app
1.07k stars 125 forks source link

setTimeout and Task Queue #49

Open demimurych opened 3 weeks ago

demimurych commented 3 weeks ago

The callback function of setTimeout doesn't immediately enter the Task Queue. It only does so after the timer expires. However, in a web interface, this happens instantly, which is an error.

stepancar commented 1 week ago

Good catch.

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers Says

I think what would be nice to have here is visualisation for map of active timers https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#map-of-active-timers