-
Notifications
You must be signed in to change notification settings - Fork 111
Creating More Accuracy in NS_TO_S #460
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
base: rolling
Are you sure you want to change the base?
Changes from 3 commits
196e3bf
375e2f2
431e7f6
627a2ea
006e414
4f51c49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,10 @@ extern "C" | |
| #define RCUTILS_US_TO_NS(microseconds) ((microseconds) * 1000LL) | ||
|
|
||
| /// Convenience macro to convert nanoseconds to seconds. | ||
| #define RCUTILS_NS_TO_S(nanoseconds) ((nanoseconds) / (1000LL * 1000LL * 1000LL)) | ||
| #define RCUTILS_NS_TO_S(nanoseconds) \ | ||
| ((1e-9 * (double)((int32_t)(nanoseconds % 1000000000l))) + \ | ||
| ((double)((int32_t)((nanoseconds - ((int32_t)(nanoseconds % 1000000000l))) / 1000000000l)))) | ||
|
||
|
|
||
| /// Convenience macro to convert nanoseconds to milliseconds. | ||
| #define RCUTILS_NS_TO_MS(nanoseconds) ((nanoseconds) / (1000LL * 1000LL)) | ||
| /// Convenience macro to convert nanoseconds to microseconds. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.