lib/game.js: update getTimeRemaining function