MCPcopy Create free account
hub / github.com/FastLED/FastLED / bench

Function bench

tests/fl/gfx/blur.cpp:269–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267__attribute__((noinline)) static double bench(Func fn, int iterations, int warmup = 200) {
268#else
269__attribute__((noinline)) static double bench(Func fn, int iterations, int warmup = 2) {
270#endif
271 for (int i = 0; i < warmup; ++i)
272 fn();
273 fl::u32 t0 = fl::micros();
274 for (int i = 0; i < iterations; ++i)
275 fn();
276 fl::u32 t1 = fl::micros();
277 return static_cast<double>(t1 - t0) * 1000.0 /
278 static_cast<double>(iterations); // ns per iteration
279}
280
281template <int R, int W, int H>
282__attribute__((noinline)) static void run_benchmark(const char *label, int iters) {

Callers 3

run_benchmarkFunction · 0.85
run_benchmark_blur_onlyFunction · 0.85
blur.cppFile · 0.85

Calls 1

microsFunction · 0.50

Tested by

no test coverage detected