From ca2220214e4e5258e6a9c85938cef13d8552487e Mon Sep 17 00:00:00 2001 From: thebirk Date: Sun, 6 Jan 2019 19:40:57 +0100 Subject: [PATCH] Added diff() to core:time. --- core/time/time.odin | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/time/time.odin b/core/time/time.odin index 7b4fb9a01..51c77a468 100644 --- a/core/time/time.odin +++ b/core/time/time.odin @@ -41,6 +41,10 @@ Weekday :: enum int { Saturday, } +diff :: proc(start, end: Time) -> Duration { + d := end._nsec - start._nsec; + return Duration(d); +} duration_nanoseconds :: proc(d: Duration) -> i64 { return i64(d);