| 69 | // Benchmark helper |
| 70 | template<typename Func> |
| 71 | double 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 |
| 86 | void run_benchmark(const char* test_name, const fl::string& json_data, int iterations, bool& success) { |
no test coverage detected