You need to `run()` it first before even waiting those fibers. `Start` doesn't 
run immediately.
    
    
    import std/[strformat]
    import std/[os]
    import std/[times,monotimes]
    import std/[coro]
    
    
    
    proc doSleep() = sleep 3000
    
    var fibers: seq[CoroutineRef] = @[]
    
    let st = getMonoTime()
    for i in 0..<10:
      fibers.add start(doSleep)
    run() # add this
    
    for i in fibers.items:
      i.wait
    
    let ed = getMonoTime()
    
    echo fmt"elapsed: {(ed-st).inMilliseconds}ms"
    
    
    Run

Though it shouldn't crash when there's nothing to wait.

Reply via email to