Translated timer.js to CoffeeScript