From 769cabbadf295fbe26cd2c3eb6efd5233c4d14e8 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 23 Nov 2022 15:56:37 +0100 Subject: util/time: use int64_t return value for get_current_time_msec() 0xFFFFFFFF milliseconds is 4,294,967,295 ms so about 50 days. A little bit too close for comfort. Use int64_t instead of uint64_t to avoid C's implicit conversion footguns in computations. --- include/util/time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/util/time.h b/include/util/time.h index 287698de..890fe55f 100644 --- a/include/util/time.h +++ b/include/util/time.h @@ -6,7 +6,7 @@ /** * Get the current time, in milliseconds. */ -uint32_t get_current_time_msec(void); +int64_t get_current_time_msec(void); /** * Convert a timespec to milliseconds. -- cgit v1.2.3