Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kevinjwalters opened this issue Mar 9, 2020 · 1 comment

Comments

@kevinjwalters
Copy link

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
@ladyada ladyada transferred this issue from adafruit/Adafruit_CircuitPython_LSM6DS Mar 9, 2020
@jepler jepler added this to the 5.x.x - Bug Fixes milestone Mar 9, 2020
@dhalbert
Copy link
Collaborator

Closing in favor of #2865, which is a dupe but has had more discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants