mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-26 15:49:58 -07:00
brk: first commit
This commit is contained in:
15
_src/structs/instant.rs
Normal file
15
_src/structs/instant.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use std::time::Instant;
|
||||
|
||||
use color_eyre::owo_colors::OwoColorize;
|
||||
|
||||
pub trait DisplayInstant {
|
||||
fn display(&self) -> String;
|
||||
}
|
||||
|
||||
impl DisplayInstant for Instant {
|
||||
fn display(&self) -> String {
|
||||
format!("{:.2}s", self.elapsed().as_secs_f32())
|
||||
.bright_black()
|
||||
.to_string()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user