summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-02-23 15:44:34 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-02-23 15:44:34 -0800
commite61733e9b92758e807a6587e906cdce477307ca3 (patch)
tree37f6531e7fccad27c199d8c20b376acabbbaf66a
parentcf9cdaade95defa2e78b5bd78105a072f028eefc (diff)
downloadtempo-e61733e9b92758e807a6587e906cdce477307ca3.tar.gz
tempo-e61733e9b92758e807a6587e906cdce477307ca3.tar.xz
Align timer interval with start of second.
-rw-r--r--tempo.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/tempo.js b/tempo.js
index db8c039..04c1071 100644
--- a/tempo.js
+++ b/tempo.js
@@ -29,7 +29,8 @@ function updateTime() {
function startTempo() {
updateTime();
- setInterval(updateTime, 1000);
+ setTimeout(function() {updateTime(); setInterval(updateTime, 1000)},
+ 1000 - new Date().getTime() % 1000);
}
window.onload = startTempo;