Simple timer and chronometer written in JavaScript