diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-04-06 10:15:10 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-04-06 10:15:10 +0000 |
commit | 780b962336cfe614406b0e56fde3f0a130693d6c (patch) | |
tree | 10138d1a2e812dcd3dea6f956b8e21b8a8404624 /lib/timeval.h | |
parent | bbeb840916c446a605d3c4645800b6add1f32b77 (diff) | |
download | curl-780b962336cfe614406b0e56fde3f0a130693d6c.tar.gz |
provide these functions as curlx_* ones as this enables the curl app to
re-use these sources and functions for subsecond resolution timing
Diffstat (limited to 'lib/timeval.h')
-rw-r--r-- | lib/timeval.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/timeval.h b/lib/timeval.h index cb984c8a6..39da52a6f 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -23,6 +23,11 @@ * $Id$ ***************************************************************************/ +/* + * CAUTION: this header is designed to work when included by the app-side + * as well as the library. Do not mix with library internals! + */ + #include "setup.h" #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) @@ -40,10 +45,20 @@ struct timeval { #endif #endif -struct timeval Curl_tvnow(void); +struct timeval curlx_tvnow(void); -/* the diff is from now on returned in number of milliseconds! */ -long Curl_tvdiff(struct timeval t1, struct timeval t2); +/* + * Make sure that the first argument (t1) is the more recent time and t2 is + * the older time, as otherwise you get a weird negative time-diff back... + * + * Returns: the time difference in number of milliseconds. + */ +long curlx_tvdiff(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) + #endif |