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

Maximum value of «Time Spent» in Cmd-window is «0:35:47» (35 min and 47 sec). #4165

Closed
7-904-001-67-28 opened this issue Jul 29, 2019 · 4 comments
Labels

Comments

@7-904-001-67-28
Copy link

@7-904-001-67-28 7-904-001-67-28 commented Jul 29, 2019

In last cURL for Windows (https://curl.haxx.se/windows/)
Time spent

maximum value of «Time Spent» in Cmd-window is «0:35:47» (35 min and 47 sec). At this point the timer is stopping and other dependent values (average speed, etc) are ruined.

Sorry, I do not speak English, I can not understand ALL from this point to end of field.

I did this

I expected the following

curl/libcurl version

[curl -V output]

operating system

@bagder bagder added the Windows label Jul 29, 2019
@bagder

This comment has been minimized.

Copy link
Member

@bagder bagder commented Jul 29, 2019

That's 2147 seconds or 2147,000 milliseconds or 2147,000,000 microseconds.

2^31 is 2147,483,648. Seems like it isn't a coincidence. Are we using a 32 bit counter (on Windows) somewhere somehow where we shouldn't?

@7-904-001-67-28

This comment has been minimized.

Copy link
Author

@7-904-001-67-28 7-904-001-67-28 commented Jul 29, 2019

Thank you for 2^31 – it is great reason.

@bagder

This comment has been minimized.

Copy link
Member

@bagder bagder commented Jul 29, 2019

The problem is here. timediff_t is made an int for systems where time_t is only 32 bit, but it seems a bit too naive. We should make it attempt to use a 64 bit variable for that so that it better can hold microseconds beyond 35 minutes.

curl/lib/timeval.c

Lines 205 to 212 in d23e87d

timediff_t Curl_timediff_us(struct curltime newer, struct curltime older)
{
timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec;
if(diff >= (TIME_MAX/1000000))
return TIME_MAX;
else if(diff <= (TIME_MIN/1000000))
return TIME_MIN;
return diff * 1000000 + newer.tv_usec-older.tv_usec;

@7-904-001-67-28

This comment has been minimized.

Copy link
Author

@7-904-001-67-28 7-904-001-67-28 commented Jul 29, 2019

Thank you!

bagder added a commit that referenced this issue Jul 30, 2019
Fixes #4165
bagder added a commit that referenced this issue Jul 31, 2019
... to make it hold microseconds too.

Fixes #4165
Closes #4168
bagder added a commit that referenced this issue Jul 31, 2019
... to make it hold microseconds too.

Fixes #4165
Closes #4168
bagder added a commit that referenced this issue Jul 31, 2019
... to make it hold microseconds too.

Fixes #4165
Closes #4168
@bagder bagder closed this in b1616da Aug 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.