Commit 8192310d authored by Daniel Campora's avatar Daniel Campora
Browse files

tests/wipy: Improve robustness of time test.

parent ef369249
...@@ -61,12 +61,12 @@ spot_test(-1072915201, (1965, 12, 31, 23, 59, 59, 4, 365)) ...@@ -61,12 +61,12 @@ spot_test(-1072915201, (1965, 12, 31, 23, 59, 59, 4, 365))
t1 = time.time() t1 = time.time()
time.sleep(2) time.sleep(2)
t2 = time.time() t2 = time.time()
print(time.ticks_diff(t1, t2) == 2) print(abs(time.ticks_diff(t1, t2) -2) <= 1)
t1 = time.ticks_ms() t1 = time.ticks_ms()
time.sleep_ms(50) time.sleep_ms(50)
t2 = time.ticks_ms() t2 = time.ticks_ms()
print(time.ticks_diff(t1, t2) == 50) print(abs(time.ticks_diff(t1, t2)- 50) <= 1)
t1 = time.ticks_us() t1 = time.ticks_us()
time.sleep_us(1000) time.sleep_us(1000)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment