2022-05-18 08:19:32 +00:00
|
|
|
import pkg/chronos
|
|
|
|
|
2022-05-17 09:50:52 +00:00
|
|
|
type
|
|
|
|
Clock* = ref object of RootObj
|
|
|
|
SecondsSince1970* = int64
|
|
|
|
|
|
|
|
method now*(clock: Clock): SecondsSince1970 {.base.} =
|
|
|
|
raiseAssert "not implemented"
|
2022-05-18 08:19:32 +00:00
|
|
|
|
|
|
|
proc waitUntil*(clock: Clock, time: SecondsSince1970) {.async.} =
|
|
|
|
while clock.now() < time:
|
|
|
|
await sleepAsync(1.seconds)
|