Gmail for Mobile HTML5: Using Timers Effectively

Neil Thomas of the Gmail for Mobile team discusses about “timers, and how to use them effectively (setTimeout/setInterval)” in his Gmail for Mobile HTML5 series post. There are old questions here.... should you use lots of timers, or use one uber-timer that coordinates life? Here’re some thoughts from Neil: “When I first started working on the new […]

Neil Thomas of the Gmail for Mobile team discusses about “timers, and how to use them effectively (setTimeout/setInterval)” in his Gmail for Mobile HTML5 series post. There are old questions here.... should you use lots of timers, or use one uber-timer that coordinates life? Here’re some thoughts from Neil: “When I first started working on the new version of Gmail for mobile, the application used only a couple of timers. As we continued adding more and more features, the number of timers grew. We were curious about the performance implications: would 10 concurrent timers make the app feel slow? How about 100? How would the performance of many low-frequency timers compare to a single high-frequency timer?”