mirror of
https://github.com/logos-storage/logos-storage-nim-dht.git
synced 2026-01-03 22:13:06 +00:00
chronosim: add timewarp
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
d8b0421af5
commit
527db66a02
@ -15,8 +15,16 @@ logScope:
|
||||
topics = "ChronoSim"
|
||||
|
||||
const
|
||||
timeWarp = 1
|
||||
emulateDatagram = true
|
||||
|
||||
# chronos uses SomeIntegerI64. We shoudl be more specific here to override
|
||||
proc milliseconds*(v: int): Duration {.inline.} =
|
||||
chronos.milliseconds(v * timeWarp)
|
||||
|
||||
proc seconds*(v: int): Duration {.inline.} =
|
||||
chronos.seconds(v * timeWarp)
|
||||
|
||||
when(emulateDatagram): #enable network emulator
|
||||
type
|
||||
DatagramCallback* = proc(transp: DatagramTransport,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user