def f2(): sleep(T2) r2.append(nanotime())
def f1(): sleep(T1) r1.append(nanotime())
def main(): PERIOD = 0.1 * SECOND start = nanotime() sleep(PERIOD) diff = nanotime() - start assert PERIOD - DELTA0 <= diff <= PERIOD + DELTA