Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
2fd463e9
Commit
2fd463e9
authored
20 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Dirk Manske increased the resolution for what the CURLINFO_*_TIME return.
parent
de8660a9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/progress.c
+7
-7
7 additions, 7 deletions
lib/progress.c
lib/timeval.c
+11
-0
11 additions, 0 deletions
lib/timeval.c
lib/timeval.h
+9
-0
9 additions, 0 deletions
lib/timeval.h
with
27 additions
and
7 deletions
lib/progress.c
+
7
−
7
View file @
2fd463e9
...
...
@@ -148,26 +148,26 @@ void Curl_pgrsTime(struct SessionHandle *data, timerid timer)
case
TIMER_NAMELOOKUP
:
data
->
progress
.
t_nslookup
=
(
double
)
Curl_tvdiff
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
)
/
1000
.
0
;
Curl_tvdiff
_secs
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
);
break
;
case
TIMER_CONNECT
:
data
->
progress
.
t_connect
=
(
double
)
Curl_tvdiff
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
)
/
1000
.
0
;
Curl_tvdiff
_secs
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
);
break
;
case
TIMER_PRETRANSFER
:
data
->
progress
.
t_pretransfer
=
(
double
)
Curl_tvdiff
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
)
/
1000
.
0
;
Curl_tvdiff
_secs
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
);
break
;
case
TIMER_STARTTRANSFER
:
data
->
progress
.
t_starttransfer
=
(
double
)
Curl_tvdiff
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
)
/
1000
.
0
;
Curl_tvdiff
_secs
(
Curl_tvnow
(),
data
->
progress
.
t_startsingle
);
break
;
case
TIMER_POSTRANSFER
:
/* this is the normal end-of-transfer thing */
break
;
case
TIMER_REDIRECT
:
data
->
progress
.
t_redirect
=
(
double
)
Curl_tvdiff
(
Curl_tvnow
(),
data
->
progress
.
start
)
/
1000
.
0
;
Curl_tvdiff
_secs
(
Curl_tvnow
(),
data
->
progress
.
start
);
break
;
}
}
...
...
@@ -249,8 +249,8 @@ int Curl_pgrsUpdate(struct connectdata *conn)
now
=
Curl_tvnow
();
/* what time is it */
/* The time spent so far (from the start) */
data
->
progress
.
timespent
=
Curl_tvdiff
(
now
,
data
->
progress
.
start
)
/
1000
.
0
;
timespent
=
(
long
)
data
->
progress
.
timespent
;
data
->
progress
.
timespent
=
Curl_tvdiff
_secs
(
now
,
data
->
progress
.
start
);
timespent
=
(
long
)
data
->
progress
.
timespent
*
1000
.
0
;
/* The average download speed this far */
data
->
progress
.
dlspeed
=
...
...
This diff is collapsed.
Click to expand it.
lib/timeval.c
+
11
−
0
View file @
2fd463e9
...
...
@@ -98,6 +98,17 @@ long curlx_tvdiff(struct timeval newer, struct timeval older)
(
newer
.
tv_usec
-
older
.
tv_usec
)
/
1000
;
}
/*
* Same as curlx_tvdiff but with full usec resolution.
*
* Returns: the time difference in seconds with subsecond resolution.
*/
double
curlx_tvdiff_secs
(
struct
timeval
newer
,
struct
timeval
older
)
{
return
(
double
)(
newer
.
tv_sec
-
older
.
tv_sec
)
+
(
double
)(
newer
.
tv_usec
-
older
.
tv_usec
)
/
1000000
.
0
;
}
/* return the number of seconds in the given input timeval struct */
long
Curl_tvlong
(
struct
timeval
t1
)
{
...
...
This diff is collapsed.
Click to expand it.
lib/timeval.h
+
9
−
0
View file @
2fd463e9
...
...
@@ -54,11 +54,20 @@ struct timeval curlx_tvnow(void);
* Returns: the time difference in number of milliseconds.
*/
long
curlx_tvdiff
(
struct
timeval
t1
,
struct
timeval
t2
);
/*
* Same as curlx_tvdiff but with full usec resolution.
*
* Returns: the time difference in seconds with subsecond resolution.
*/
double
curlx_tvdiff_secs
(
struct
timeval
t1
,
struct
timeval
t2
);
long
Curl_tvlong
(
struct
timeval
t1
);
/* These two defines below exist to provide the older API for library
internals only. */
#define Curl_tvnow() curlx_tvnow()
#define Curl_tvdiff(x,y) curlx_tvdiff(x,y)
#define Curl_tvdiff_secs(x,y) curlx_tvdiff_secs(x,y)
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment