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.
pull/3633/merge
Damien George 2018-03-04 00:17:33 +11:00
rodzic 512f4a6ad1
commit e3d11b6a6e
2 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

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