Embedded-Profiling
A lightweight framework for profiling functions, geared towards
no-std
embedded environments. Initialization is very similar
to how the log
crate is initialized. By default, there is a
no-op profiler that does nothing until you call [set_profiler].
Once your profiler has been installed, your profiling
functionality will be in use.
Usage
You can manually start & end your snapshot:
let start = start_snapshot;
// (...) some expensive computation
let snapshot = end_snapshot;
// Optionally, log it
log_snapshot;
Or profile some code in a closure:
;
profile
With a Procedural Macro
With the proc-macros
feature enabled, you can simply annotate
the target function with the procedural macro
profile_function.
Note that you must first set your profiler with the [set_profiler]
function.
#