Closed Bug 348323 Opened 18 years ago Closed 18 years ago

Two setInterval duplications

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 234016

People

(Reporter: ivan, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

Two calls setInterval function produced duplicate callback calls

Reproducible: Always

Steps to Reproduce:
1. call two setInterval
2. view result
Actual Results:  
four callback calls

Expected Results:  
two callback calls
No problem here, two messages logged every second as I'd expect.

Tested on 1.5.0.6 and current Minefield.
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

After the first few seconds (where it works correctly), I see four simultaneous calls every two seconds - so it's the correct rate (average two per second), but not spread out correctly. Changing the test case to say:

    setInterval(function(h){log('interval 1 ('+h+' ms late)')}, 1000)
    setInterval(function(h){log('interval 2 ('+h+' ms late)')}, 1000)

results in:

Fri Aug 11 2006 12:59:26 GMT+0100 (GMT Daylight Time)interval 1 (31 ms late)
Fri Aug 11 2006 12:59:26 GMT+0100 (GMT Daylight Time)interval 2 (31 ms late)
Fri Aug 11 2006 12:59:26 GMT+0100 (GMT Daylight Time)interval 1 (-968 ms late)
Fri Aug 11 2006 12:59:26 GMT+0100 (GMT Daylight Time)interval 2 (-968 ms late)
Fri Aug 11 2006 12:59:28 GMT+0100 (GMT Daylight Time)interval 1 (15 ms late)
Fri Aug 11 2006 12:59:28 GMT+0100 (GMT Daylight Time)interval 2 (15 ms late)
Fri Aug 11 2006 12:59:28 GMT+0100 (GMT Daylight Time)interval 1 (-984 ms late)
Fri Aug 11 2006 12:59:28 GMT+0100 (GMT Daylight Time)interval 2 (-984 ms late)

which agrees that half of the callbacks are occurring a second too early, which is far from expected behaviour.
This appears to be bug 234016

*** This bug has been marked as a duplicate of 234016 ***
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.