diff options
| author | thebirk <pingnor@gmail.com> | 2019-01-06 19:40:57 +0100 |
|---|---|---|
| committer | thebirk <pingnor@gmail.com> | 2019-01-06 19:40:57 +0100 |
| commit | ca2220214e4e5258e6a9c85938cef13d8552487e (patch) | |
| tree | afb5123db3c2ea5aaa65cc85f1813e2f1991b165 | |
| parent | a32f024d94d79c8bebe02907c33e817c6711863c (diff) | |
Added diff() to core:time.
| -rw-r--r-- | core/time/time.odin | 4 |
1 files changed, 4 insertions, 0 deletions
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); |