Skip to content

time.sleep() narcoleptic on nRF52840 (Feather Sense) #4525

Open
@ericwertz

Description

@ericwertz

Short calls to time.sleep(t) end up sleeping for 1.0+t seconds. Found this by sleeping for short periods between bit-banging through the phases of a four-phase stepper. It would simply stop multiple times per minute for exactly one second, then continue.

This happens on multiple Sense boards but I have not been able to reproduce it on the M4 running it for (only) 10 minutes.
narcoleptic-nrf

import time

while True:
    t0 = time.monotonic()
    time.sleep(0.002)
    t = time.monotonic() - t0
    if t > 0.1: print("[redacted]! ", t0, t)

In addition to the as-shown example, this test continues to fail with args up to (at least) 0.025.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions