Revise `profiler.h`
albinahlback opened this issue · comments
Macros like
#define TIMEIT_ONCE_START \
do \
{ \
timeit_t __timer; \
timeit_start(__timer); \
do { \
#define TIMEIT_ONCE_STOP \
} while (0); \
timeit_stop(__timer); \
TIMEIT_PRINT(__timer, 1) \
} while (0); \
could be more well-designed so that one has to write semi-colon after each macro (so that it does not mess with the indentation of any editor).
But I think it is a wise idea to revise the whole header. Preferably, one would like to set FLINT_CLOCKSPEED
during the configuration via something like lscpu
or /proc/cpuinfo
if one is not cross-compiling.
regarding FLINT_CLOCKSPEED I used something like this https://github.com/edgarcosta/ToricControlledReduction/blob/main/timing.h
but only works for Darwin and Linux
regarding FLINT_CLOCKSPEED I used something like this https://github.com/edgarcosta/ToricControlledReduction/blob/main/timing.h but only works for Darwin and Linux
Sorry, but is it CLOCKS_PER_SEC
you mean? Or what am I supposed to be looking at?
Yes. I am sorry, I could have written that comment much better.