Files
brk/_src/structs/instant.rs
2025-02-23 01:25:15 +01:00

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()
}
}