pub struct ProcessTimings {
pub stages: Vec<(&'static str, Duration)>,
pub frames: u64,
}Expand description
Accumulated processing time breakdown by named pipeline stage.
Each backend defines its own stages (e.g. "fbank", "cmvn", "onnx"),
so you can see exactly where time is spent without hardcoding a fixed set
of fields. Stages are returned in pipeline order.
Call VoiceActivityDetector::timings() to retrieve the current values.
Timings accumulate across all calls to process()
and are not reset by reset().
§Example
ⓘ
let t = vad.timings();
for (name, dur) in &t.stages {
let avg_us = dur.as_secs_f64() * 1_000_000.0 / t.frames as f64;
println!("{name}: {avg_us:.1} µs/frame");
}Fields§
§stages: Vec<(&'static str, Duration)>Named timing stages in pipeline order.
Each entry is (stage_name, accumulated_duration). The stage names
are backend-specific — for example FireRedVAD reports "fbank",
"cmvn", and "onnx", while Silero reports "normalize" and "onnx".
frames: u64Number of frames that produced a result (excludes buffering-only frames).
Trait Implementations§
Source§impl Clone for ProcessTimings
impl Clone for ProcessTimings
Source§fn clone(&self) -> ProcessTimings
fn clone(&self) -> ProcessTimings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProcessTimings
impl Debug for ProcessTimings
Source§impl Default for ProcessTimings
impl Default for ProcessTimings
Source§fn default() -> ProcessTimings
fn default() -> ProcessTimings
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProcessTimings
impl RefUnwindSafe for ProcessTimings
impl Send for ProcessTimings
impl Sync for ProcessTimings
impl Unpin for ProcessTimings
impl UnsafeUnpin for ProcessTimings
impl UnwindSafe for ProcessTimings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more