clarify what a 'monotonic' timestamp is (#18163)

This commit is contained in:
Andreas Rumpf 2021-06-03 16:27:34 +02:00 • committed by GitHub
commit 0aa8b793a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@
##[ ##[
The `std/monotimes` module implements monotonic timestamps. A monotonic The `std/monotimes` module implements monotonic timestamps. A monotonic
timestamp represents the time that has passed since some system defined timestamp represents the time that has passed since some system defined
point in time. The monotonic timestamps are guaranteed to always increase, point in time. The monotonic timestamps are guaranteed not to decrease,
meaning that that the following is guaranteed to work: meaning that that the following is guaranteed to work:
]## ]##
@ -18,9 +18,8 @@ runnableExamples:
import std/os import std/os
let a = getMonoTime() let a = getMonoTime()
sleep(10)
let b = getMonoTime() let b = getMonoTime()
assert a < b assert a <= b
##[ ##[
This is not guaranteed for the `times.Time` type! This means that the This is not guaranteed for the `times.Time` type! This means that the