Changing timer_t to cmc_timer to not generate conflicts
This commit is contained in:
1 parent
f7a598efc8
commit
c60ee10185
3 files changed
+9
-7
No files matched your search
+1
-1
@@ -98,7 +98,7 @@ static void cmc_test_log(const char *unit_name, const char *current_test, bool a
|
||||
const char *current_test = NULL; \
|
||||
\
|
||||
cmc_test_info tinfo = {0}; \
|
||||
timer_t timer = {0}; \
|
||||
cmc_timer timer = {0}; \
|
||||
\
|
||||
tinfo.verbose = VERBOSE; \
|
||||
\
|
||||
|
||||
+7
-5
@@ -15,31 +15,33 @@
|
||||
|
||||
#include <time.h>
|
||||
|
||||
typedef struct timer_s
|
||||
typedef struct cmc_timer_s
|
||||
{
|
||||
clock_t start;
|
||||
clock_t stop;
|
||||
double result;
|
||||
} timer_t;
|
||||
} cmc_timer;
|
||||
|
||||
#define timer_start(timer) \
|
||||
do \
|
||||
{ \
|
||||
(timer).start = clock(); \
|
||||
cmc_timer *t = &(timer); \
|
||||
t->start = clock(); \
|
||||
\
|
||||
} while (0)
|
||||
|
||||
#define timer_stop(timer) \
|
||||
do \
|
||||
{ \
|
||||
(timer).stop = clock(); \
|
||||
cmc_timer *t = &(timer);\
|
||||
t->stop = clock(); \
|
||||
\
|
||||
} while (0)
|
||||
|
||||
#define timer_calc(timer) \
|
||||
do \
|
||||
{ \
|
||||
timer_t *t = &(timer); \
|
||||
cmc_timer *t = &(timer); \
|
||||
t->result = (double)(t->stop - t->start) * 1000.0 / CLOCKS_PER_SEC; \
|
||||
\
|
||||
} while (0)
|
||||
|
||||
Reference in new issue
Block a user