Mercurial > urweb
diff lib/js/urweb.js @ 1514:3c0803c1acd7
Backpedal on tutorial-motivated urweb-mode changes; add Basis.diffInSeconds and Basis.toSeconds
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 22 Jul 2011 15:39:38 -0400 |
parents | b2ca3e1e5b40 |
children | 883347f5c3c2 |
line wrap: on
line diff
--- a/lib/js/urweb.js Wed Jul 20 08:14:49 2011 -0400 +++ b/lib/js/urweb.js Fri Jul 22 15:39:38 2011 -0400 @@ -105,6 +105,14 @@ return (new Date()).getTime() * 1000; } +function diffInSeconds(tm1, tm2) { + return Math.round((tm2 - tm1) / 1000000); +} + +function toSeconds(tm) { + return Math.round(tm / 1000000); +} + // Error handling