summary refs log tree commit diff stats
path: root/tests/stdlib/tmonotimes.nim
blob: f10fef591c24e7ee263a0d9812dd5cfe23d3475a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
discard """
  targets: "c js"
"""

import std/[monotimes, times]
import std/assertions

let d = initDuration(nanoseconds = 10)
let t1 = getMonoTime()
let t2 = t1 + d

doAssert t2 - t1 == d
doAssert t1 == t1
doAssert t1 != t2
doAssert t2 - d == t1
doAssert t1 < t2
doAssert t1 <= t2
doAssert t1 <= t1
doAssert not(t2 < t1)
doAssert t1 < high(MonoTime)
doAssert low(MonoTime) < t1