use std::time::{Instant};

pub struct Timer<'a> {
    name: &'a str,
    start_time: Instant
}

impl<'a> Timer<'a> {
    pub fn start(name: &'a str) -> Timer {
        Timer {
            name: name,
            start_time: Instant::now()
        }
    }

    pub fn print_status(&self) {
        println!("{}: {}ms", self.name, Instant::now().duration_since(self.start_time).as_nanos() as f32 / 1_000_000.0)
    }
}