diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2009-09-20 18:03:39 -0700 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2009-09-20 18:03:39 -0700 |
commit | e2cc4e353a73595aebd13ba89cc8b057a6242b27 (patch) | |
tree | a78db94a3b89d488e4e30e00010d004f60f28b60 /src/common/util.h | |
parent | cf2afcd7072d20755ad030ed8240c21ec649dcd7 (diff) | |
download | tor-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.h | 3 |
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); |