From 0d728f96b7042633aff21c3208e1481e17b9442e Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Thu, 7 Nov 2024 10:22:56 +0100 Subject: [PATCH] util/time: Move NSEC_PER_SEC to header This constant can be useful whenever one has to deal with timespecs, so let's move it to the header. --- include/util/time.h | 2 ++ util/time.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/util/time.h b/include/util/time.h index 3f76aa47f..dd164bf2f 100644 --- a/include/util/time.h +++ b/include/util/time.h @@ -4,6 +4,8 @@ #include #include +static const long NSEC_PER_SEC = 1000000000; + /** * Get the current time, in milliseconds. */ diff --git a/util/time.c b/util/time.c index bc4a10637..1a8f32969 100644 --- a/util/time.c +++ b/util/time.c @@ -3,8 +3,6 @@ #include "util/time.h" -static const long NSEC_PER_SEC = 1000000000; - int64_t timespec_to_msec(const struct timespec *a) { return (int64_t)a->tv_sec * 1000 + a->tv_nsec / 1000000; }