Converted setInterval to setTimeout chain

Improves browser responsiveness as it waits for the previous call to finish before starting a new one.