pypy.module.time.test.apptest_time:test_clock_gettime
def test_clock_gettime():
import time
clock_ids = ['CLOCK_REALTIME',
'CLOCK_REALTIME_COARSE',
'CLOCK_MONOTONIC',
'CLOCK_MONOTONIC_COARSE',
'CLOCK_MONOTONIC_RAW',
'CLOCK_BOOTTIME',
'CLOCK_PROCESS_CPUTIME_ID',
'CLOCK_THREAD_CPUTIME_ID',
'CLOCK_HIGHRES',
'CLOCK_PROF',
'CLOCK_UPTIME',]
for clock_id in clock_ids:
clock = getattr(time, clock_id, None)
if clock is None:
continue
t1 = time.clock_gettime_ns(clock)
assert isinstance(t1, int)
time.sleep(time.clock_getres(clock))
t2 = time.clock_gettime_ns(clock)
> assert t1 < t2
E assert 136742703848418210 < 136742703848418210
../build/pypy/module/time/test/apptest_time.py:144: AssertionError
builder: pypy-c-jit-linux-aarch64 build #2938+
test: pypy.module.time.test.apptest_time:test_clock_gettime