global-duration 0.2.1

Enables simple measurement of durations between arbitrary points in Rust code
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::time::Instant;

pub struct Checkpoint {
    pub name: String,
    pub instant: Instant,
}

impl Checkpoint {
    pub fn new(name: &str) -> Checkpoint {
        Checkpoint {
            name: String::from(name),
            instant: Instant::now(),
        }
    }
}