From c723667d402b730edc4059cb132587977893b42a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 22 Jul 2011 15:39:38 -0400 Subject: Backpedal on tutorial-motivated urweb-mode changes; add Basis.diffInSeconds and Basis.toSeconds --- lib/js/urweb.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/js') 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 -- cgit v1.2.3