Files
Nim/tests/stdlib/tmonotimes.nim
ringabout 4fa86422c0 stdlib tests now check refc too (#21664)
* stdlib tests now check refc too

* typo

* fixes line numbers

* disable cpp

* do not touch
2023-04-21 15:37:58 +02:00

23 lines
411 B
Nim

discard """
matrix: "--mm:refc; --mm:orc"
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