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

Feature request: high resolution clock for later? #180

Open
dereckmezquita opened this issue Oct 30, 2023 · 1 comment
Open

Feature request: high resolution clock for later? #180

dereckmezquita opened this issue Oct 30, 2023 · 1 comment

Comments

@dereckmezquita
Copy link

dereckmezquita commented Oct 30, 2023

I'd be interested in using R at high speeds to run an interval with logic.

Can we incorporate a high-resolution clock to run an interval with precision? I want to run at the ms to a microsecond precision level.

Could we somehow leverage Cpp's chrono and high_resolution_clock? Is R capable of running at these speeds?

If worth pursuing I'd be interested in contributing to later to implement this.

@shikokuchuo
Copy link
Contributor

timespec_get() is defined in tinycthread.h in the package source, so this should already be high resolution (down to the nanosecond, but limited by the resolution of the system clock).

The C++ chrono::high_resolution_clock forwards to the same underlying (system-dependent) implementation according to the second answer here: https://stackoverflow.com/questions/12392278/

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

No branches or pull requests

2 participants