Documentation for foreach.h, test.h, timer.h and other changes

Change in timer.h. Now cmc_timer_stop will calculate the result so goodbye cmc_timer_calc
This commit is contained in:
Leonardo committed 2020-04-10 22:21:47 -03:00
1 parent aa214d179e
commit 67590790c4
12 files changed
+451 -36

No files matched your search

-1
View File
@@ -101,7 +101,6 @@ static void cmc_test_log(const char *unit_name, const char *current_test,
BODY; \
\
cmc_timer_stop(timer); \
cmc_timer_calc(timer); \
\
unittest_abort: \
if (tinfo.aborted) \
+12 -20
View File
@@ -24,28 +24,20 @@ struct cmc_timer
double result; /* The result is given in milliseconds */
};
#define cmc_timer_start(timer) \
do \
{ \
struct cmc_timer *t = &(timer); \
t->start = clock(); \
\
#define cmc_timer_start(timer) \
do \
{ \
struct cmc_timer *t__ = &(timer); \
t__->start = clock(); \
} while (0)
#define cmc_timer_stop(timer) \
do \
{ \
struct cmc_timer *t = &(timer); \
t->stop = clock(); \
\
} while (0)
#define cmc_timer_calc(timer) \
do \
{ \
struct cmc_timer *t = &(timer); \
t->result = (double)(t->stop - t->start) * 1000.0 / CLOCKS_PER_SEC; \
\
#define cmc_timer_stop(timer) \
do \
{ \
struct cmc_timer *t__ = &(timer); \
t__->stop = clock(); \
t__->result = \
(double)(t__->stop - t__->start) * 1000.0 / CLOCKS_PER_SEC; \
} while (0)
#endif /* CMC_TIMER_H */