vor 0.2.0

Cross-platform performance instrumentation with an in-app egui panel and live system and GPU metrics.
Documentation
/// A profiler backend.
///
/// Installs a global `tracing` subscriber so spans emitted by
/// [`profile`](crate::profile) and
/// [`profile_scope!`](crate::profile_scope) flow into the
/// backend-specific output — a Chrome-trace file on native, the
/// DevTools timeline on web.
///
/// `install` is called once per process. Drop the returned [`Guard`]
/// to flush any buffered events.
pub trait Sink {
    fn install(self) -> Guard;
}

/// Opaque per-process guard. Drop to flush.
pub struct Guard {
    _inner: Box<dyn std::any::Any>,
}

impl Guard {
    /// Wrap any value whose `Drop` flushes the backing sink.
    pub fn new<T: 'static>(flush: T) -> Self {
        Self {
            _inner: Box::new(flush),
        }
    }
}