Ejemplo n.º 1
0
    def main():
        PERIOD = 0.1 * SECOND

        start = nanotime()
        sleep(PERIOD)
        diff = nanotime() - start
        assert PERIOD - DELTA0 <= diff <= PERIOD + DELTA
Ejemplo n.º 2
0
 def f():
     i -= 1
     if i >= 0:
         AfterFunc(0, f)
         sleep(1 * SECOND)
     else:
         c.send(True)
Ejemplo n.º 3
0
 def f():
     i -= 1
     if i >= 0:
         AfterFunc(0, f)
         sleep(1 * SECOND)
     else:
         c.send(True)
Ejemplo n.º 4
0
    def main():
        PERIOD = 0.1 * SECOND

        start = nanotime()
        sleep(PERIOD)
        diff = nanotime() - start
        assert PERIOD - DELTA0 <= diff <= PERIOD + DELTA
Ejemplo n.º 5
0
        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()
Ejemplo n.º 6
0
        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()
Ejemplo n.º 7
0
def say(s):
    for i in range(5):
        time.sleep(100 * time.MILLISECOND)
        print(s)
Ejemplo n.º 8
0
def say(s):
    for i in range(5):
        time.sleep(100 * time.MILLISECOND)
        print(s)