예제 #1
0
    def main():
        t = Timer(f, 0.01 * SECOND, 0.01 * SECOND, args=(proc.current(), ))
        t.start()
        park()

        assert len(r) == 3
        assert r[2] > r[1]
        assert r[1] > r[0]
예제 #2
0
    def main():
        t = Timer(f, 0.01 * SECOND, 0.01 * SECOND, args=(proc.current(),))
        t.start()
        park()

        assert len(r) == 3
        assert r[2] > r[1]
        assert r[1] > r[0]
예제 #3
0
    def main():
        rlist = []
        period = 0.1 * SECOND
        t = Timer(_func, period, args=(rlist, proc.current()))
        now = nanotime()
        t.start()
        park()
        delay = rlist[0]

        assert (now + period - DELTA0) <= delay <= (now + period + DELTA), delay
예제 #4
0
    def main():
        rlist = []
        period = 0.1 * SECOND
        t = Timer(_func, period, args=(rlist, proc.current()))
        now = nanotime()
        t.start()
        park()
        delay = rlist[0]

        assert (now + period - DELTA0) <= delay <= (now + period +
                                                    DELTA), delay
예제 #5
0
    def main():
        T1 = 0.4 * SECOND
        T2 = 0.1 * SECOND
        t1 = Timer(f1, T1, args=(proc.current(), ))
        t2 = Timer(f2, T2)

        now = nanotime()
        t1.start()
        t2.start()

        park()

        assert r1[0] > r2[0]

        assert (now + T1 - DELTA0) <= r1[0] <= (now + T1 + DELTA), r1[0]
        assert (now + T2 - DELTA0) <= r2[0] <= (now + T2 + DELTA), r2[0]
예제 #6
0
    def main():
        T1 = 0.4 * SECOND
        T2 = 0.1 * SECOND
        t1 = Timer(f1, T1, args=(proc.current(),))
        t2 = Timer(f2, T2)

        now = nanotime()
        t1.start()
        t2.start()

        park()

        assert r1[0] > r2[0]

        assert (now + T1 - DELTA0) <= r1[0] <= (now + T1 + DELTA), r1[0]
        assert (now + T2 - DELTA0) <= r2[0] <= (now + T2 + DELTA), r2[0]