From 8623b9ace63c3f71e19df35245639b6174acb431 Mon Sep 17 00:00:00 2001 From: Laurent MAZET Date: Wed, 15 Oct 2025 18:09:48 +0200 Subject: [PATCH] change sys_timestamp into macro --- mtime.c | 5 ----- mtime.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/mtime.c b/mtime.c index 220d4d6..67c6ee7 100644 --- a/mtime.c +++ b/mtime.c @@ -2,11 +2,6 @@ #include "mtime.h" -void sys_timestamp (ts_t *ts) -{ - clock_gettime (CLOCK_REALTIME, ts); -} - dts_t diff_timestamp (ts_t *ts1, ts_t *ts2) { return (dts_t)(ts1->tv_sec - ts2->tv_sec) * 1000000000 + diff --git a/mtime.h b/mtime.h index 7085bb7..974441a 100644 --- a/mtime.h +++ b/mtime.h @@ -9,7 +9,7 @@ typedef struct timespec ts_t; typedef unsigned int dts_t; -void sys_timestamp (ts_t *ts); +#define sys_timestamp(ts) clock_gettime (CLOCK_REALTIME, (ts)) dts_t diff_timestamp (ts_t *ts1, ts_t *ts2); -- 2.30.2