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
Add built-in nanosecond-precision clocks #3068
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me, aside from the commented code that might have snuck in.
-- natToEFBox = inNat arg nat result $ outIoFail stack1 stack2 fail result | ||
-- where | ||
-- (arg, nat, stack1, stack2, fail, result) = fresh6 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this commented code could go?
@dolio are all these implementable in Chez land? (This is something we should always ask ourselves for new builtins I think) |
This adds a few builtins for nanosecond-precision clocks.
realtime
returns the civic time as nanoseconds since epoch.monotonic
returns a number of nanoseconds since an arbitrary point in the past, guaranteed to monotonically increase on subsequent calls. This is unaffected by time changes and other processes changing the system clock.processCPUTime
returns the amount of time spent in the Unison process running the program.threadCPUTime
returns the amount of time spent in the OS thread running the program.