use chronosFutureDuration to measure time
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
2c7685229d
commit
f24ca72de0
7
das.nim
7
das.nim
|
@ -116,7 +116,6 @@ when isMainModule:
|
|||
|
||||
# generate block and push data
|
||||
info "starting upload to DHT"
|
||||
let startTime = Moment.now()
|
||||
var futs = newSeq[Future[seq[Node]]]()
|
||||
for s in 0 ..< blocksize:
|
||||
let
|
||||
|
@ -127,8 +126,10 @@ when isMainModule:
|
|||
|
||||
futs.add(nodes[0][0].addValue(key, segment))
|
||||
|
||||
let pass = await allFutures(futs).withTimeout(upload_timeout)
|
||||
info "uploaded to DHT", by = 0, pass, time = Moment.now() - startTime
|
||||
let
|
||||
allFinished = allFutures(futs).withTimeout(upload_timeout)
|
||||
pass = await allFinished
|
||||
info "uploaded to DHT", by = 0, pass, time = allFinished.duration
|
||||
|
||||
# sample
|
||||
proc startSamplingDA(n: discv5_protocol.Protocol): seq[Future[DiscResult[seq[byte]]]] =
|
||||
|
|
1
das.nims
1
das.nims
|
@ -1,2 +1,3 @@
|
|||
patchFile("chronos", "chronos", "chronosim/chronos")
|
||||
patchFile("nimcrypto", "rijndael", "chronosim/rijndael")
|
||||
--d:chronosFutureDuration
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5b9ec0837c4f6774b68bd9e5ccc36bd79a65e57d
|
||||
Subproject commit 2f66813f92a4d7cedbd9086c42f6a227be39eed1
|
Loading…
Reference in New Issue