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

Windows: GetTickCount has too low timer resolution #3309

Closed
pps83 opened this issue Nov 26, 2018 · 2 comments
Closed

Windows: GetTickCount has too low timer resolution #3309

pps83 opened this issue Nov 26, 2018 · 2 comments
Labels
enhancement Windows Windows-specific

Comments

@pps83
Copy link
Contributor

pps83 commented Nov 26, 2018

GetTickCount does not necessarily have good precision if somebody tries to debug/analyze timings. It could have 1 or even 10 ms precision.
Would it be acceptable to submit a patch that adds a CURL option that sets TIMER FUNCTION that would be used to retrieve timestamps instead?

Alternatively it could simply use QueryPerformanceCounter/QueryPerformanceFrequency on windows.

DWORD milliseconds = GetTickCount();

@bagder bagder added the not-a-curl-bug This is not a bug in curl label Nov 26, 2018
@bagder
Copy link
Member

bagder commented Nov 26, 2018

option that sets TIMER FUNCTION that would be used to retrieve timestamps instead?

That would imply that some users would want different timestamps. I've never heard of such users.

Alternatively it could simply use ...

I think it would be good enough if we just used the best available high resolution timer by default.

@bagder bagder added enhancement and removed not-a-curl-bug This is not a bug in curl labels Nov 26, 2018
@bagder bagder changed the title GetTickCount p Windows: GetTickCount has too low timer resolution Nov 26, 2018
@bagder bagder added the Windows Windows-specific label Nov 26, 2018
@pps83
Copy link
Contributor Author

pps83 commented Nov 29, 2018

I think it would be good enough if we just used the best available high resolution timer by default.

See proposed fix: timeval: use QueryPerformanceCounter on Windows #3318

@jay jay closed this as completed in e9ababd Dec 23, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Mar 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Windows Windows-specific
Development

No branches or pull requests

2 participants