Closed Bug 1567049 Opened 5 years ago Closed 5 years ago

`setInterval` automatic correction

Categories

(Firefox :: Untriaged, defect)

70 Branch
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

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:

  1. open webconsole
  2. input setInterval(() => console.log(Date.now()), 1000)
  3. 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

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.

Flags: needinfo?(709922234)

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

Flags: needinfo?(709922234)

Thanks for your reply, please feel free to reopen it in case you consider that's the case.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: