mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
* make more standard libraries work with `nimPreviewSlimSystem` * typo * part two * Delete specutils.nim * fixes more tests * more fixes * fixes tests * fixes three more tests * add formatfloat import * fix * last
22 lines
379 B
Nim
22 lines
379 B
Nim
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
|