Skip to content

time.sleep() inaccuracies on Windows 7 (with a Metro M4 Express) #3912

@CFRED86

Description

@CFRED86

I was encouraged to post this issue here after discussing it on the Adafruit Metro M4 Express forums - here is the thread.

Essentially it seems like time.sleep() provides inaccurate intervals on Windows 7. Below are excerpts from the thread referenced above, but it's also worth noting that the release notes stated there were changes to the sleep functionality in CP 6.0.0 which may have introduced issues. I have also confirmed that sleep works properly (for my needs) in prior releases and this issue first appears in 6.x.

  • works fine on my Windows 10 workstation (at my desk), but not on my Windows 7
  • sleep of ~0.1 <= x < 1.0 seconds, then my output is a period of 1.0 second. If I use a period of 1.0 second, then my output immediately jumps to 2.0 seconds.
  • If the sleep duration is very short (e.g. 0.01 or less), then the code execution appears to either stop/crash or grind to a near halt.

3.1.2 (with 3.x library) worked
4.1.0 (with 3.x library) worked - I could not find the 4.x library
5.0.0 (with 5.x library) worked
5.3.1 (with 5.x library) worked
6.0.0 (with 6.x library) does not work - appears to hang during time.sleep()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions