mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* stdlib tests now check refc too * typo * fixes line numbers * disable cpp * do not touch
23 lines
411 B
Nim
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
|