# setInterval irregularity?

**URL:** <https://forum.kirupa.com/t/setinterval-irregularity/25914>\
**Category:** flash\
**Created:** [July 17, 2003, 4:13pm UTC](https://forum.kirupa.com/t/setinterval-irregularity/25914 "2003-07-17T16:13:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weedallc](https://avatars.discourse-cdn.com/v4/letter/w/2acd7d/32.png) [@weedallc](https://forum.kirupa.com/u/weedallc)\
**Post date:** [July 17, 2003, 4:13pm UTC](https://forum.kirupa.com/t/setinterval-irregularity/25914/1 "2003-07-17T16:13:31Z")

</div>

Hi, I am having some strangeness occur with the setInterval function. I am using it to call a function which loads a dynamic image. At the moment, I have it set to call the function every 1000\*numberSeconds (which is set at the moment to 10). So, theoretically, it should call that funciton every 10 seconds. Although it generally follows that pattern, I have noticed that this functions seems to be called early a sporatic number of times. Sometimes it gets called in 5 seconds, sometimes 7 seconds, sometimes 8 seconds, etc. It never seems to take more than 11 or 12 seconds though.

I was wondering if anyone knows why this function seems to be random sometimes? I am not doing anything special that should make it act crazy. Since I am just doing

[AS]setInterval(newMovie, 1000\*numberSeconds);[/AS]

That should be pretty stable and nice, right? Well, that doesn’t seem tto be the case, at least not consistently. Has anyone else had similar problems? Does anyone know a cure or fix? Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 17, 2003, 4:19pm UTC](https://forum.kirupa.com/t/setinterval-irregularity/25914/2 "2003-07-17T16:19:48Z")

</div>

well setInterval isnt _exact_. Whether or not other circumstances are involved in its misbehavior, Im not sure. But 5 seconds from 10 does seem a little off.

If you want something more exact you might want to consider onEnterFrame with getTimer()
