mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 22:59:58 -07:00
16 lines
315 B
Rust
16 lines
315 B
Rust
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()
|
|
}
|
|
}
|