mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Move timeit to stdx
This commit is contained in:
parent
72a0db8dc4
commit
1b68c72fe9
2 changed files with 15 additions and 16 deletions
|
@ -113,21 +113,6 @@ pub fn profile(label: Label) -> Profiler {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn print_time(label: Label) -> impl Drop {
|
||||
struct Guard {
|
||||
label: Label,
|
||||
start: Instant,
|
||||
}
|
||||
|
||||
impl Drop for Guard {
|
||||
fn drop(&mut self) {
|
||||
eprintln!("{}: {:?}", self.label, self.start.elapsed())
|
||||
}
|
||||
}
|
||||
|
||||
Guard { label, start: Instant::now() }
|
||||
}
|
||||
|
||||
pub struct Profiler {
|
||||
label: Option<Label>,
|
||||
detail: Option<String>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue