Is it possible to update in intervals similar to 10nths of milliseconds. I used
window.setInterval(timeUpdate,20);
Is this possible or does the browser's thread have some sort of minimum period?
Thanks
Is it possible to update in intervals similar to 10nths of milliseconds. I used
window.setInterval(timeUpdate,20);
Is this possible or does the browser's thread have some sort of minimum period?
Thanks
Depending on the browser, it's version and if there's focus on the tab, the timer resolution may differ. For more detail please have a look at the following refrence, especially the Minimum delay and timeout nesting part.
It is possible to set a very small interval (1 ms, for example); however, most browsers have a minimal timer granularity, usually somewhere between 4-50 ms; special cases may apply for inactive browser views/tabs/windows.
So: the function call is correct, and will complete successfully, but don't expect that you'll actually get that very short resolution - first, the browser may not give it to you, and second, the computer may not be fast enough to process the events at that speed, even if the event fires that quickly.