From 2fd463e979ca57c07be4c54e945c33de8651c17c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 9 Apr 2004 09:36:31 +0000 Subject: Dirk Manske increased the resolution for what the CURLINFO_*_TIME return. --- lib/timeval.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/timeval.c') diff --git a/lib/timeval.c b/lib/timeval.c index 20ac6ea96..11f3d7a06 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -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) { -- cgit v1.2.1