summaryrefslogtreecommitdiff
path: root/lib/timeval.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-30 08:11:54 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-30 08:11:54 +0000
commitcd160a66c96f769e821d22bb7d4f2b36dd6f4be2 (patch)
tree3ac9e2270ffa11b994083754bcb5adfc6ba3fe83 /lib/timeval.c
parenta7376968d2fac572a085d81bfac8b16e18e83d1e (diff)
downloadcurl-cd160a66c96f769e821d22bb7d4f2b36dd6f4be2.tar.gz
added more comments for what the functions return
Diffstat (limited to 'lib/timeval.c')
-rw-r--r--lib/timeval.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/timeval.c b/lib/timeval.c
index dff9aa841..b9bd1f994 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -78,7 +78,8 @@ static int gettimeofday(struct timeval *tp, void *nothing)
#endif /* WIN32 */
#endif /* HAVE_GETTIMEOFDAY */
-struct timeval Curl_tvnow (void)
+/* Return the current time in a timeval struct */
+struct timeval Curl_tvnow(void)
{
struct timeval now;
(void)gettimeofday(&now, NULL);
@@ -88,14 +89,17 @@ struct timeval Curl_tvnow (void)
/*
* Make sure that the first argument is the more recent time, as otherwise
* we'll get a weird negative time-diff back...
+ *
+ * Returns: the time difference in number of milliseconds.
*/
-long Curl_tvdiff (struct timeval newer, struct timeval older)
+long Curl_tvdiff(struct timeval newer, struct timeval older)
{
return (newer.tv_sec-older.tv_sec)*1000+
(499+newer.tv_usec-older.tv_usec)/1000;
}
-long Curl_tvlong (struct timeval t1)
+/* return the number of seconds in the given input timeval struct */
+long Curl_tvlong(struct timeval t1)
{
return t1.tv_sec;
}