This commit is contained in:
Aleksey Kladov 2020-07-30 10:43:47 +02:00
parent 5e498546e8
commit f22af66c37

View file

@ -1,3 +1,4 @@
//! Like `std::time::Instant`, but also measures memory & CPU cycles.
use std::{ use std::{
fmt, fmt,
time::{Duration, Instant}, time::{Duration, Instant},
@ -76,14 +77,3 @@ impl fmt::Display for StopWatchSpan {
Ok(()) Ok(())
} }
} }
// Unclear if we need this:
// https://github.com/jimblandy/perf-event/issues/8
impl Drop for StopWatch {
fn drop(&mut self) {
#[cfg(target_os = "linux")]
if let Some(mut counter) = self.counter.take() {
let _ = counter.disable();
}
}
}