aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2009-09-20 18:03:39 -0700
committerMike Perry <mikeperry-git@fscked.org>2009-09-20 18:03:39 -0700
commite2cc4e353a73595aebd13ba89cc8b057a6242b27 (patch)
treea78db94a3b89d488e4e30e00010d004f60f28b60 /src/common/util.h
parentcf2afcd7072d20755ad030ed8240c21ec649dcd7 (diff)
downloadtor-e2cc4e353a73595aebd13ba89cc8b057a6242b27.tar.gz
tor-e2cc4e353a73595aebd13ba89cc8b057a6242b27.zip
Add a couple of time helper functions.
Also add rounding support to tv_mdiff().
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index bb384a2a33..28ea8a0488 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -212,6 +212,9 @@ void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen);
int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen);
/* Time helpers */
+double tv_to_double(const struct timeval *tv);
+int64_t tv_to_msec(const struct timeval *tv);
+int64_t tv_to_usec(const struct timeval *tv);
long tv_udiff(const struct timeval *start, const struct timeval *end);
long tv_mdiff(const struct timeval *start, const struct timeval *end);
time_t tor_timegm(struct tm *tm);