timetrace 0.2.0

Lightweight Rust profiling library with RAII and Chrome/Perfetto trace support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::profile_result::*;

pub trait TracingBackend {
    fn begin_session(&mut self, name: &str, filepath: &str);
    fn begin_session_limited(
        &mut self,
        name: &str,
        filepath: &str,
        max_frames: Option<usize>,
        max_duration_ms: Option<u64>,
    );
    fn end_session(&mut self) -> Result<(), String>;
    fn new_frame(&mut self);
    fn record_event(&mut self, event: &ProfileResult);
    fn record_span(&mut self, name: &str);
}