From 69933c5b521eacd968c4d78ad769ea7a3d6b872f Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Thu, 24 Oct 2019 14:20:49 +0300 Subject: diagnostic: print time since program start instead. Signed-off-by: Gediminas Jakutis --- include/rin/definitions.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/rin/definitions.h') diff --git a/include/rin/definitions.h b/include/rin/definitions.h index 7ba65a6..9995e0f 100644 --- a/include/rin/definitions.h +++ b/include/rin/definitions.h @@ -63,4 +63,14 @@ do { \ } \ } while (0) +/* CLOCK_MONOTONIC is prefered when available, as + * it does not suffer from discontinous jumps. + * Otherwise use CLOCK_REALTIME as fallback. + */ +#if defined CLOCK_MONOTONIC +# define RIN_CLOCK_WALL_COUNTER CLOCK_MONOTONIC +#else +# define RIN_CLOCK_WALL_COUNTER CLOCK_REALTIME +#endif /* defined CLOCK_MONOTONIC */ + #endif /* LIBRIN_DEFINITIONS_INCLUDED */ -- cgit v1.2.3