A library for simple profiling your code with HTML reports as result.
Usage
At first the rprofiler must be initialized by the call rprofiler::PROFILER.initialize() method.
This method is returned an object of ProfilerData struct, where will be gathering all runtime information.
Then you can use special profile_block macro for profiling blocks of your code. It has some syntax variations:
profile_block!;
profile_block!;
// Conditional profiling
profile_block!;
profile_block!;
This macro generates special internal events, which will be pushed to internal events queue.
You should call the rprofiler::PROFILER.process_events(...) method periodically to process this events and clear the queue.
As example, this method can be called at end of each game frame.
At end of profiling you should call the rprofiler::PROFILER.shutdown(...) method.
It will process all gathered information and save result as HTML document into specified file.
You can disable all profiling at compile-time by enabling a feature "disable_profiling" in Cargo.toml of your project.
[]
= "game"
= "0.1.0"
= "2018"
[]
= "0.2"
= ["disable_profiling"]
Examples