aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/js
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-07-22 15:39:38 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2011-07-22 15:39:38 -0400
commitc723667d402b730edc4059cb132587977893b42a (patch)
tree6656ba1a78bd4eb71c381dc95d2e7b1a8ce6b130 /lib/js
parent02d95a3ae4ed3519b082fe49616e493572e68e83 (diff)
Backpedal on tutorial-motivated urweb-mode changes; add Basis.diffInSeconds and Basis.toSeconds
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/urweb.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 76ad76fa..9834fde6 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -105,6 +105,14 @@ function now() {
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