Web browsers and time

Today I had an interesting task of figuring out why a piece of code I’d written a few weeks ago for autosaving user changes wasn’t being called as uniformly as we’d thought.

That is, on IE6 and FF, we were seeing a particular piece of code take almost twice as long to execute as it ought because (as we later found out) timings in javascript can’t be trusted.

So, if you need something to run on time, at regular intervals; use a polling pattern instead of relying on the usual javascript methods.

No related content found.


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.