This is a thing enforced by browser - if the tab is inactive, the game is only allowed one "frame" per several seconds. This is best workarounded by measuring the time since last frame (via current_time, for example) and applying the changes in bulk when user switches back to the game.