safari minimized stops javascript settimeout

Safari 9.1 for El Capitan

Safari 10 for Sierra


What is Safari doing in the JavaScript engine with respect to setTimeout() when the browser or the tab loses focus?


I have created a simple JavaScript web application that I load in Safari that calls JavaScript setTimeout() that passes another function to be executed after the timeout value The function prints the date/time to the console, then calls setTimeout() with the same timeout value.


If the Safari tab loses focus or the browser is minimized, after some time it seems Safari stops executing the setTimeout, and the subsequent function to be called, and until focus is returned, no function execution occurs.


NOTE: No function calls are lost, they are only paused, and restarted when the browser regains focus.


I do not notice this in Firefox, Chrome or IE11.