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.
This commit is contained in:
Damien George 2018-03-04 00:17:33 +11:00
parent 512f4a6ad1
commit e3d11b6a6e
2 changed files with 4 additions and 0 deletions

View File

@ -9,3 +9,6 @@ utime.sleep_ms(1)
utime.sleep_us(1)
print(utime.ticks_diff(utime.ticks_ms(), utime.ticks_ms()) <= 1)
print(utime.ticks_diff(utime.ticks_us(), utime.ticks_us()) <= 500)
# ticks_cpu may not be implemented, at least make sure it doesn't decrease
print(utime.ticks_diff(utime.ticks_cpu(), utime.ticks_cpu()) >= 0)

View File

@ -1,2 +1,3 @@
True
True
True