def main(): PERIOD = 0.1 * SECOND start = nanotime() sleep(PERIOD) diff = nanotime() - start assert PERIOD - DELTA0 <= diff <= PERIOD + DELTA
def f(): i -= 1 if i >= 0: AfterFunc(0, f) sleep(1 * SECOND) else: c.send(True)
def search(provider, term): print 'searching with %r' % provider results = provider.search(term, streaming=True) for result in results: channel.send(result) sleep(SECOND) print 'done searching with %r' % provider wait.done()
def say(s): for i in range(5): time.sleep(100 * time.MILLISECOND) print(s)