`setInterval` automatic correction
Categories
(Firefox :: Untriaged, defect)
Tracking
()
People
(Reporter: 709922234, Unassigned)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
- open webconsole
- input
setInterval(() => console.log(Date.now()), 1000)
- observation output
Actual results:
deviation will accumulate
Expected results:
automatically adjust the delay to correct the deviation
More reliable when we use setInterval
to perform some timing tasks
Comment 3•5 years ago
|
||
I tested this on Mac OS X 10.14 with FF Nightly 70.0a1(2019-07-21) and here is my result from the console.
I'm not sure what should I see here and what is the problem in your case.
If the first print 1563974514669
I hope the 100th print 1563974514669 + 1000*10 + delay
Instead of 1563974514669 + (1000 + delay)*10
But the practicality is not high, you can close this bug
Comment 5•5 years ago
|
||
Thanks for your reply, please feel free to reopen it in case you consider that's the case.
Description
•