Open bunhere opened 1 day ago
Actually I think this is an error in the book. The code later in the chapter is correct, but this one is not quite correct,
because schedule_animation_frame
is called in the main event loop constantly and the timer scheduling is not throttled.
I'm making a PR now to fix it, thanks for reporting.
https://github.com/browserengineering/book/blob/567507769945691c3aa00527328a09a93553c3a5/book/scheduling.md?plain=1#L614-L617
Could you let me know whether I understand this sentence correctly.
Note how every time a frame is scheduled, we set up a timer to schedule the next one. -> Note that when
schedule_animation_frame
is called, we set up a timer to schedule the nextrender
.As a non-native English reader, I am confused by the two uses of the verb 'schedule.'