diff --git a/tests/extmod/time_ms_us.py b/tests/extmod/time_ms_us.py new file mode 100644 index 0000000000..2078f1bb53 --- /dev/null +++ b/tests/extmod/time_ms_us.py @@ -0,0 +1,12 @@ +import sys +import utime +try: + utime.sleep_ms +except AttributeError: + print("SKIP") + sys.exit() + +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) diff --git a/tests/extmod/time_ms_us.py.exp b/tests/extmod/time_ms_us.py.exp new file mode 100644 index 0000000000..dbde422651 --- /dev/null +++ b/tests/extmod/time_ms_us.py.exp @@ -0,0 +1,2 @@ +True +True