Skip to content

time.sleep(N) returns immediately if prior time.sleep interrupted in REPL on 5.0.0 on nRF52840 #2691

Closed
@kevinjwalters

Description

@kevinjwalters

time.sleep() seems to misbehave if it is control-c'd in REPL:

Adafruit CircuitPython 5.0.0 on 2020-03-02; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>>
>>> import board, time
>>> board.DISPLAY.auto_refresh = False  # can affect timing
>>> time.sleep(3)
>>> time.sleep(3)
>>> time.sleep(10)  # control-c after a few seconds
>>> time.sleep(1)
>>> time.sleep(10)
>>> time.sleep(100) # last three returned immediately
>>> t1=time.monotonic() ; time.sleep(100) ; print(time.monotonic() - t1)
0.0

>>> print(time.monotonic())
3483.65
>>> print(time.monotonic()) # still works
3484.34
>>> print(time.monotonic_ns())
3513715188000
>>> print(time.monotonic_ns()) # still works
3514536192000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions