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

import std/[monotimes, times]

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