Skip to content
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

Switch to time.monotonic_ns() when it's available #10

Open
wants to merge 6 commits into
base: master
from

Conversation

@tgs
Copy link

tgs commented Aug 13, 2019

Hi again!
Here's the work I've done so far. I wrote tests to make sure I wasn't introducing breaking changes (that I could think of... do you see any?). There doesn't seem to be a CircuitPython standard testing library, so I just wrote some minimal version inside the tests.py file. If you don't want to merge in the tests, that would be OK.

After 3 days of on-time, the current version of the debouncer code fails test_simple on line 25 - the time returned by monotonic() hasn't ticked yet in the .02 seconds of sleep. The new version passes all the tests. I've run it on an ItsyBitsy M0 Express at boot and at 2 and 3 days, and a Trinket M0 at boot (where it doesn't have monotonic_ns).

Let me know what you think!

This should close issue #9.

Copy link
Contributor

tannewt left a comment

Looks awesome! Thank you!

@tannewt

This comment has been minimized.

Copy link
Contributor

tannewt commented Aug 16, 2019

@tgs

This comment has been minimized.

Copy link
Author

tgs commented Aug 17, 2019

@tannewt

This comment has been minimized.

Copy link
Contributor

tannewt commented Aug 19, 2019

Great! Thank you in advance! Hope you had a good weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.