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

Function benchmark_microseconds

tests/profile/json_performance.cpp:71–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69// Benchmark helper
70template<typename Func>
71double benchmark_microseconds(Func&& func, int iterations) {
72 // Warmup
73 func();
74
75 u32 start = fl::micros();
76 for (int i = 0; i < iterations; i++) {
77 func();
78 }
79 u32 end = fl::micros();
80
81 u32 duration = end - start;
82 return static_cast<double>(duration) / iterations;
83}
84
85// Helper to run benchmark on a JSON string
86void run_benchmark(const char* test_name, const fl::string& json_data, int iterations, bool& success) {

Callers 1

run_benchmarkFunction · 0.70

Calls 1

microsFunction · 0.50

Tested by

no test coverage detected