Function print

Source
pub fn print()
Expand description

Prints out the data gathered by the profiler. Uses format::STREAMLINED as the default format.

Prints out something like this:

╶──┬╼ main                        - 100.0%, 300 ms/loop
   ├──┬╼ physics simulation       -  66.7%, 200 ms/loop
   │  ├───╼ moving things         -  50.0%, 100 ms/loop
   │  └───╼ resolving collisions  -  50.0%, 100 ms/loop
   └───╼ rendering                -  33.3%, 100 ms/loop
Examples found in repository?
examples/main.rs (line 22)
4fn main() {
5    use std::thread;
6    use std::time::Duration;
7
8    let process = || {
9        perf_measure!("processing");
10        thread::sleep(Duration::from_millis(100));
11    };
12
13    for _ in 0..2 {
14        perf_measure!("main");
15        for _ in 0..2 {
16            perf_measure!("inner operations");
17            process();
18        }
19        process();
20    }
21
22    stperf::print();
23}