glassbench 0.4.4

rust benchmark with memory
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::time::Duration;

/// The result of the measure of a task: number of iterations
/// and total duration
#[derive(Debug, Clone, Copy)]
pub struct TaskMeasure {
    pub iterations: u32,
    pub total_duration: Duration,
}

impl TaskMeasure {
    /// compute the only value you're normally interested into:
    /// the mean duration
    pub fn mean_duration(&self) -> Duration {
        self.total_duration / self.iterations
    }
}