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

Use clock_gettime_nsec_np for current time #6

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

koznobikhin
Copy link

Changed DispatchTime.now().rawValue to clock_gettime_nsec_np(CLOCK_MONOTONIC) to make it work correctly on Apple Silicon
Fixed subtraction test to make sense

@koznobikhin
Copy link
Author

should fix the issue with the Spinner

@dominicegginton
Copy link
Owner

dominicegginton commented Oct 16, 2024

@koznobikhin
Many thanks for your time in contributing.

I have updated this branch to include running tests on both MacOS and Ubuntu GH runners and I see a currently failing test. I was unable to find a quick solution with the time I had the other weekend but will continue to look into this. Any help from the community here would be appreciated. Currently only able to easily locally test on my x86_64-linux based system, but the solution should be expected to work on aarch64-darwin, aarch64-linux, x86_64-darwin & x86_64-linux systems.

I would also like the keep this library compatible with Apple's MacOS, IOS, etc.... I wonder if clock_gettime_nsec_np falls under Apple's naughty list of kernel APIs due to its implementation calling mach_absolute_time directly, and would prevent this?

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

Successfully merging this pull request may close these issues.

2 participants