Skip to content

monotonic_ns jumps #9953

Open
Open
@dheera

Description

@dheera

CircuitPython version

6.0.0

Code/REPL

import time
for i in range(1000000000):
    print(time.monotonic_ns())
    time.sleep(0.001)

Behavior

1431848724366
1431849700929
1431850677491
1431851654054
1431852630616
1431853607179
1431854583741
1431855560304
1431856536866
1431857513429
1431858520509
1431859466554 <--
1432001098634 <-- wtf?
1432002044679
1432003021241
1432003997804
1432004974366
1432005981447
1432006927491
1432007904054
1432008911134
1432009857179
1432010833741
1432011810304
1432012786866

Description

It seems that the nanoseconds part is counting slower than it should be and then plays catch up at the next whole second

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions