Results 1 to 2 of 2
Jul 13, 2006, 08:54 #1
For some time I've noticed that IE and FF respond WILDLY different to Timeouts - after some testing I noticed that FF seems to run timeouts almost unthrottled if you set it below 60ms - and above 60ms it seems to respond about 50% over what I'm asking for...
While IE always ticks reasonably accurate at 15ms or faster, and as low as 10ms if the computer in question is fast enough...
I'm wondering if I should attempt to correct the number I'm feeding firefox using a sniffer, or if I should write a 'timer monitor' to compare against the system clock, and adjust the amount I'm moving around elements on the screen so that they go the same distance in the same time regardless of browser (or at least close enough most users wouldn't notice)... any input on the timers in browsers and their use would be most welcome.
*** warning *** loads lots of images before it starts functioning, so may take a bit to load (the images are small, but ping times can be murder)... no collision detection yet, arrow keys move you around.
It can also 'lose' images and have to reload them from time to time if your browser cache is too small... I'm probably just going to rewrite in SVG once I have a command of that down halfway decent.
Jul 13, 2006, 13:17 #2
- Join Date
- Jul 2005
- West Springfield, Massachusetts
- 149 Post(s)
- 1 Thread(s)
I recently found out that the settimeout function has a "mystery" argument that is different in different browsers. I think I saw a bug report dealing with really long time intervals calling it the "delay" argument (or something like that). This page calls it the "lateness" argument. http://virtuelvis.com/archives/2005/...with-arguments
I don't think you can "force" a value for the argument, the browsers "add" it.
But you may be able to access the value from within your function and deal with it there.
Or maybe you could try setinterval instead, although it may have the "mystery' argument too.
As for losing images, images have a complete property. Although support for this has been described as "dodgy", you can test for it and if false reload the image. It may not be 100% dependable, but unless you have a real lot of images it should help.