From 5b94910fc4c6a47856290e9c23f9a905cf63c1eb Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 17 Apr 2019 14:38:23 +0200 Subject: Add and use a new timer API. --- common.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index 0a36ca9..03b33f6 100644 --- a/common.h +++ b/common.h @@ -24,16 +24,18 @@ #define MIN(x, y) ((x) > (y) ? (y) : (x)) #define ARRAY_ELEMS(arr) (sizeof(arr) / sizeof(*arr)) +#include #include #include -#include -static inline int64_t gettime(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; -} #define FD_STENCIL_MAX 4 +#define mg2di_assert(x) \ +do { \ + if (!(x)) { \ + fprintf(stderr, "Assertion " #x " failed\n"); \ + abort(); \ + } \ +} while (0) + #endif /* MG2D_COMMON_H */ -- cgit v1.2.3