-
Notifications
You must be signed in to change notification settings - Fork 18
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
A backend for Ruby >= 2.1 using Process.clock_gettime #72
Comments
@eregon I had this as a todo for a long time (see #22) and after digging into it last year it looked ruby natively doesn't support the nanosecond resolution on at least OSX even though it could. And after reviewing the code I was looking at last summer...It appears I was looking at the wrong bits of the ruby source code. I did a better review just now - and it looks like that ruby's I'll play around with some things and see what comes out. In any case - this would probably end up with a major version bump just to cover the < Ruby 2.1 deprecation. |
Sounds good. I searched for FWIW, I found out recent macOS also supports One way to already use |
Just FYI, I moved to using So, @copiousfreetime your offer to update the gem is awesome, but if you have other things to spend your time on that are more valuable to you, it's no longer a dependency of Thanks so much for this gem and all your work. |
Almost completed extension removal over in #73 |
This looks great! |
@eregon well - my pure ruby version also doesn't work on truffleruby 😂 - I've sent a pull request over to truffle ruby - oracle/truffleruby#1594 - not sure if that's the right way to go or not - all feedback welcome. |
@copiousfreetime Great 😃 I also commented on the PR #73. Did Hitimes provide clock resolution before? |
Version 2.0.0 pushed with no C extension |
Thanks a lot! |
Since Ruby 2.1, there is
Process.clock_gettime(Process::CLOCK_MONOTONIC, :nanosecond)
.This uses the appropriate syscall based on the platform.
If
hitimes
would use this on Ruby >= 2.1, I think no C or JRuby extension would be needed, and there would be no need to access macOS frameworks.The issue was initially reported in oracle/truffleruby#1436, where TruffleRuby does not support
-framework
yet. It probably could, but it seems better to use a core method when available rather than re-implementing it with a C extension.Do you want to keep supporting Ruby 2.0?
If not, then the whole C/JRuby extensions could likely go away altogether, but that would also mean every gem depending on
hitimes
must drop Ruby <= 2.0 support too.@copiousfreetime What do you think?
The text was updated successfully, but these errors were encountered: