Beispiel #1
0
    def main():
        PERIOD = 0.1 * SECOND

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

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