code: def sleep(self, ms=1):
          
          self.scheduled.add(ms, getcurrent())
          self.loop.switch()
docs: Pauses the current green thread for *ms* milliseconds::
  
              p = h.pipe()
  
              @h.spawn
              def _():
                  p.send('1')
                  h.sleep(50)
                  p.send('2')
  
              p.recv() # returns '1'
              p.recv() # returns '2' after 50 ms