diff options
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/urweb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index 738c765c..0b04f665 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -3681,6 +3681,14 @@ uw_Basis_int uw_Basis_diffInSeconds(uw_context ctx, uw_Basis_time tm1, uw_Basis_ return difftime(tm2.seconds, tm1.seconds); } +uw_Basis_int uw_Basis_toMilliseconds(uw_context ctx, uw_Basis_time tm) { + return tm.seconds * 1000 + tm.microseconds / 1000; +} + +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); +} + uw_Basis_int uw_Basis_toSeconds(uw_context ctx, uw_Basis_time tm) { return tm.seconds; } |