27 inline void noop() __attribute__((always_inline));
28 inline
void noop() { __asm__ __volatile__(
"nop"); }
34 #define BENCHMARK_BASELINE(scale) \ 37 for (int _i = 1; _i; _i--, _baseline = micros() - _start - _baseline) \ 38 for (int _j = scale; _j; _j--, noop()) 52 #define BENCHMARK(msg,scale) \ 53 Serial.print(F(msg ": ")); \ 56 for (int _i = 1; _i; _i--, _benchmark = micros() - _start - _baseline,\ 57 Serial.println(_benchmark / (float) scale, 3)) \ 58 for (int _j = scale; _j; _j--, noop()) 70 #define MEASURE(expr) BENCHMARK(#expr,1) expr static uint32_t _benchmark
static uint32_t _baseline