]> 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>
Wed, 26 Jan 2022 09:11:52 +0000 (09:11 +0000)
src/lib/time-util.h

index 74ae9edf5ea46f16dc0a58d14b15288d1b99607c..0cda92c9dfe8c7a37adce25f4040f6c71e67b1a8 100644 (file)
@@ -69,6 +69,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);