]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: add timeval_to_usecs()
authorsergey.kitov <sergey.kitov@open-xchange.com>
Tue, 21 Dec 2021 08:47:54 +0000 (10:47 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 24 Jan 2022 09:50:20 +0000 (09:50 +0000)
src/lib/time-util.h

index 65d50142650685aec8d4466a2083ef1a90e1b49e..437144cb42d6b81f563150103facf427541cee2d 100644 (file)
@@ -77,6 +77,11 @@ timeval_sub_msecs(struct timeval *tv, unsigned int msecs)
        }
 }
 
+static inline unsigned long long timeval_to_usecs(const struct timeval *tv)
+{
+       return (tv->tv_sec * 1000000ULL + tv->tv_usec);
+}
+
 static inline void timeval_add(struct timeval *tv, const struct timeval *val)
 {
        i_assert(val->tv_usec < 1000000);