Skip to content

Commit e3d11b6

Browse files
committed
tests/extmod/time_ms_us: Add test for calling ticks_cpu().
This is just to test that the function exists and returns some kind of valid value. Although this file is for testing ms/us functions, put the ticks_cpu() test here so not to add a new test file.
1 parent 512f4a6 commit e3d11b6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

tests/extmod/time_ms_us.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
utime.sleep_us(1)
1010
print(utime.ticks_diff(utime.ticks_ms(), utime.ticks_ms()) <= 1)
1111
print(utime.ticks_diff(utime.ticks_us(), utime.ticks_us()) <= 500)
12+
13+
# ticks_cpu may not be implemented, at least make sure it doesn't decrease
14+
print(utime.ticks_diff(utime.ticks_cpu(), utime.ticks_cpu()) >= 0)

tests/extmod/time_ms_us.py.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
True
22
True
3+
True

0 commit comments

Comments
 (0)