From 09c2534e57944a9b5d6cc8971d0733d25749ade5 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 4 Feb 2012 11:01:06 -0500 Subject: Basis.toMilliseconds and diffInMilliseconds, based on a patch from Gergely Buday --- 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 b557147b..a5ab90c5 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -132,10 +132,18 @@ function diffInSeconds(tm1, tm2) { return Math.round((tm2 - tm1) / 1000000); } +function diffInMilliseconds(tm1, tm2) { + return Math.round((tm2 - tm1) / 1000); +} + function toSeconds(tm) { return Math.round(tm / 1000000); } +function toMilliseconds(tm) { + return Math.round(tm / 1000); +} + function addSeconds(tm, n) { return tm + n * 1000000; } -- cgit v1.2.3