diff src/c/urweb.c @ 2187:14c45a0b6362

Basis.fromMilliseconds
author Adam Chlipala <adam@chlipala.net>
date Sun, 01 Nov 2015 11:55:01 -0500
parents d87d72b6e299
children 985c8016b592
line wrap: on
line diff
--- a/src/c/urweb.c	Sat Oct 31 19:21:05 2015 -0400
+++ b/src/c/urweb.c	Sun Nov 01 11:55:01 2015 -0500
@@ -4060,6 +4060,11 @@
   return tm.seconds * 1000 + tm.microseconds / 1000;
 }
 
+uw_Basis_time uw_Basis_fromMilliseconds(uw_context ctx, uw_Basis_int n) {
+  uw_Basis_time tm = {n / 1000, n % 1000 * 1000};
+  return tm;
+}
+
 uw_Basis_int uw_Basis_diffInMilliseconds(uw_context ctx, uw_Basis_time tm1, uw_Basis_time tm2) {
   return uw_Basis_toMilliseconds(ctx, tm2) - uw_Basis_toMilliseconds(ctx, tm1);
 }