Skip to content

Question: DURATION #2704

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

Closed
liudongmiao opened this issue Mar 19, 2022 · 5 comments
Closed

Question: DURATION #2704

liudongmiao opened this issue Mar 19, 2022 · 5 comments

Comments

@liudongmiao
Copy link
Contributor

Currently, the DURATION is using CLOCK_PROCESS_CPUTIME_ID since 2015, introduced in commit a4cf218.

For time, nginx switch to CLOCK_MONOTONIC / CLOCK_MONOTONIC_FAST since 2018.

For openjdk, nanoTime using CLOCK_MONOTONIC. For macOS, openjdk use mach_absolute_time and mach_timebase_info, however, CLOCK_MONOTONIC is available to.

Would it ok to switch CLOCK_MONOTONIC?

@liudongmiao
Copy link
Contributor Author

@zimmerle is the original author of this. And @martinhsv is very active for this project.

@liudongmiao
Copy link
Contributor Author

However, DURATION returns seconds, cannot be used for performance time.

@liudongmiao
Copy link
Contributor Author

liudongmiao commented Mar 19, 2022

#1011 for related perf_*

@martinhsv
Copy link
Contributor

However, DURATION returns seconds, cannot be used for performance time.

I don't understand that comment.

DURATION is implemented as a variable of type double, which means it can and will return a number like 0.024000 indicating 24 milliseconds -- or 1.315 indicating 1315 milliseconds.

@liudongmiao
Copy link
Contributor Author

Sorry for the double.

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