On Monday, 5 February 2018 14:21:43 UTC+1, Evertjan. wrote:
> Jonas <
jonas.t...@gmail.com> wrote on 05
> Feb 2018 in comp.lang.javascript:
<snip>
> > to playup recorded events with their relative timing "in
> > microseconds", or if there is other options?
>
> You could poll a list ["schedule"] of tasks every so many miliseconds,
Polling might be overkill, usually just fire the setTimeout: if you want a
schedule that persists across browser sessions, you'll have to record events,
and remove them when they have executed, still at session start you can
simply scan the list and just fire the timeouts again.
> microseconds being outside the realm of practical scripting applications.
Yep, and even milliseconds or even seconds: not only the timer is low
precision, when a timeout expires, the handler is marked for execution but
shall wait for its turn to run if there are other calls already running and
in the run queue. That said, indeed one hardly needs high precision timers
in the context of web scripting, or, more generally, user interfaces.
Julio