Skip to content

Commit ab95b5a

Browse files
committed
cpython-utime: Define clock() in terms of time.process_time().
In CPython3.8+, time.clock() was removed. Signed-off-by: Paul Sokolovsky <[email protected]>
1 parent f4e00cb commit ab95b5a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpython-utime/utime.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
MICROPY_PY_UTIME_TICKS_PERIOD = 2**30
55

6-
_PASSTHRU = ("time", "sleep", "clock", "localtime")
6+
_PASSTHRU = ("time", "sleep", "localtime")
77

88
for f in _PASSTHRU:
99
globals()[f] = getattr(_time, f)
1010

11+
clock = _time.process_time()
1112

1213
def sleep_ms(t):
1314
_time.sleep(t / 1000)

0 commit comments

Comments
 (0)