* code:

    
    
    import std/[strformat]
      import std/[os]
      import std/[times,monotimes]
      import std/[coro]
      
      
      var fibers: seq[CoroutineRef] = @[]
      
      proc doSleep() = sleep 3000
      
      let st = getMonoTime()
      
      for i in 0..<10:
        fibers.add start(doSleep)
      
      for i in fibers.items:
        i.wait
      
      let ed = getMonoTime()
      
      echo fmt"elapsed: {(ed-st).inMilliseconds}ms"
    
    
    
    Run

  * error:


    
    
    SIGSEGV: Illegal storage access. (Attempt to read from nil?)
    Segmentation fault
    
    
    Run

Reply via email to