Module ark_std::perf_trace [−][src]
Expand description
This module contains macros for logging to stdout a trace of wall-clock time required to execute annotated code. One can use this code as follows:
use ark_std::{start_timer, end_timer}; let start = start_timer!(|| "Addition of two integers"); let c = 5 + 7; end_timer!(start);
The foregoing code should log the following to stdout.
Start: Addition of two integers
End: Addition of two integers... 1ns
These macros can be arbitrarily nested, and the nested nature is made apparent in the output. For example, the following snippet:
use ark_std::{start_timer, end_timer}; let start = start_timer!(|| "Addition of two integers"); let start2 = start_timer!(|| "Inner"); let c = 5 + 7; end_timer!(start2); end_timer!(start);
should print out the following:
Start: Addition of two integers
Start: Inner
End: Inner ... 1ns
End: Addition of two integers... 1ns
Additionally, one can use the add_to_trace
macro to log additional context
in the output.
Structs
TimerInfo |