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

Function benchMode

tests/profile/fft_cq_compare.cpp:98–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96};
97
98static BenchResult benchMode(Mode mode, const char *name,
99 fl::span<const fl::i16> signal, int bands,
100 float fmin, float fmax, int sampleRate,
101 int iterations) {
102 Args args(static_cast<int>(signal.size()), bands, fmin, fmax,
103 sampleRate, mode);
104 Impl fft(args);
105 Bins out(bands);
106
107 for (int i = 0; i < 10; i++) {
108 fft.run(signal, &out);
109 }
110
111 fl::u32 t0 = fl::micros();
112 for (int i = 0; i < iterations; i++) {
113 fft.run(signal, &out);
114 }
115 fl::u32 t1 = fl::micros();
116
117 fl::i64 ns = static_cast<fl::i64>(t1 - t0) * 1000LL;
118 return {name, ns, iterations};
119}
120
121// Find the bin with the highest magnitude
122static int peakBin(fl::span<const float> bins) {

Callers 2

benchSignalFunction · 0.85
runBenchmarkFunction · 0.85

Calls 3

microsFunction · 0.50
sizeMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected