Skip to content
Myr

wall_clock_timer.rs

This file

Path

src/timer/wall_clock_timer.rs

22 lines · 476 bytes · Rust

Last changed by

Remove alternative constructorsDavid Peterbefore adoption3494c8a

History of this file

Take it

The walk stopped after 200 commits: lines older than bece2ea point at it.

bug: quoting failure on windows-platform (#296)Pedro Witzelbefore adoptionbece2ea

lines 1–2why, one step back
1use std::time::Instant;
2

Remove alternative constructorsDavid Peterbefore adoption3494c8a

line 3why, one step back
3use crate::quantity::{nanosecond, second, Time};

bug: quoting failure on windows-platform (#296)Pedro Witzelbefore adoptionbece2ea

lines 4–15why, one step back
4
5pub struct WallClockTimer {6 start: Instant,7}89impl WallClockTimer {10 pub fn start() -> WallClockTimer {11 WallClockTimer {12 start: Instant::now(),13 }14 }15

Merge pull request #961 from sharkdp/codex/uom-quantitiesDavid Peterbefore adoption975a25c

line 16why, one step back
16 pub fn stop(&self) -> Time {

bug: quoting failure on windows-platform (#296)Pedro Witzelbefore adoptionbece2ea

line 17why, one step back
17 let duration = self.start.elapsed();

Use uomDavid Peterbefore adoption641451a

line 18why, one step back
18

Remove alternative constructorsDavid Peterbefore adoption3494c8a

lines 19–20why, one step back
19 Time::new::<second>(duration.as_secs() as f64)
20 + Time::new::<nanosecond>(duration.subsec_nanos() as f64)

bug: quoting failure on windows-platform (#296)Pedro Witzelbefore adoptionbece2ea

lines 21–22why, one step back
21 }
22}