diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/time.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/time.c b/source4/lib/time.c index dbbfab24b5..9d906af2fa 100644 --- a/source4/lib/time.c +++ b/source4/lib/time.c @@ -409,3 +409,10 @@ NTTIME nttime_from_string(const char *s) { return strtoull(s, NULL, 0); } + +long long usec_time_diff(struct timeval *larget, struct timeval *smallt) +{ + long long sec_diff = larget->tv_sec - smallt->tv_sec; + return (sec_diff * 1000000) + (long long)(larget->tv_usec - smallt->tv_usec); +} + |