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

Method print_result

tests/profile/profile_result.h:43–58  ·  view source on GitHub ↗

Simple one-line result printing for common case @param variant Variant name (e.g., "baseline", "optimized") @param target Function/feature being profiled @param total_calls Number of function calls executed @param elapsed_us Total elapsed time in microseconds

Source from the content-addressed store, hash-verified

41 /// @param total_calls Number of function calls executed
42 /// @param elapsed_us Total elapsed time in microseconds
43 static void print_result(const char* variant, const char* target,
44 int total_calls, fl::u32 elapsed_us) {
45 fl::i64 elapsed_ns = static_cast<fl::i64>(elapsed_us) * 1000LL;
46 double ns_per_call = static_cast<double>(elapsed_ns) / total_calls;
47 double calls_per_sec = 1e9 / ns_per_call;
48
49 fl::json result = fl::json::object();
50 result.set("variant", variant);
51 result.set("target", target);
52 result.set("total_calls", total_calls);
53 result.set("total_time_ns", elapsed_ns);
54 result.set("ns_per_call", ns_per_call);
55 result.set("calls_per_sec", calls_per_sec);
56
57 fl::printf("PROFILE_RESULT:%s\n", result.to_string().c_str());
58 }
59
60 /// Constructor for building custom results (e.g., comparison tests)
61 ProfileResultBuilder(const char* variant, const char* target)

Callers

nothing calls this directly

Calls 4

printfFunction · 0.85
setMethod · 0.45
c_strMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected