tests/wipy: Improve robustness of time test.
This commit is contained in:
parent
ef369249cb
commit
8192310dad
@ -61,12 +61,12 @@ spot_test(-1072915201, (1965, 12, 31, 23, 59, 59, 4, 365))
|
||||
t1 = time.time()
|
||||
time.sleep(2)
|
||||
t2 = time.time()
|
||||
print(time.ticks_diff(t1, t2) == 2)
|
||||
print(abs(time.ticks_diff(t1, t2) -2) <= 1)
|
||||
|
||||
t1 = time.ticks_ms()
|
||||
time.sleep_ms(50)
|
||||
t2 = time.ticks_ms()
|
||||
print(time.ticks_diff(t1, t2) == 50)
|
||||
print(abs(time.ticks_diff(t1, t2)- 50) <= 1)
|
||||
|
||||
t1 = time.ticks_us()
|
||||
time.sleep_us(1000)
|
||||
|
Loading…
Reference in New Issue
Block a user