From 270e19191b369481bbad734cb2e0441c9ca9bccd Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 24 Oct 2024 09:44:08 +0200 Subject: [PATCH] time: add gettimeofday wrapper for SCTime_t --- src/util-time.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util-time.h b/src/util-time.h index d2de7cb8db..ba3c55d3f2 100644 --- a/src/util-time.h +++ b/src/util-time.h @@ -106,6 +106,13 @@ typedef struct { #define SCTIME_CMP_LTE(a, b) SCTIME_CMP((a), (b), <=) #define SCTIME_CMP_NEQ(a, b) SCTIME_CMP((a), (b), !=) +static inline SCTime_t SCTimeGetTime(void) +{ + struct timeval tv; + gettimeofday(&tv, NULL); + return SCTIME_FROM_TIMEVAL(&tv); +} + void TimeInit(void); void TimeDeinit(void); -- 2.47.3