Display more digits when formatting time in ms and s
impl Rocks {
fn new() -> Self {
- Rocks { state: Box::new([false; N * M]) }
+ Rocks {
+ state: Box::new([false; N * M]),
+ }
}
fn get(&self, i: usize, j: usize) -> bool {
.split("->")
.map(|p| {
let ji: Vec<&str> = p.split(',').collect();
- (ji[1].parse::<usize>().unwrap(), ji[0].parse::<usize>().unwrap())
+ (
+ ji[1].parse::<usize>().unwrap(),
+ ji[0].parse::<usize>().unwrap(),
+ )
})
.tuple_windows()
{
if t < 10_000 {
format!("{} μs", t)
} else if t < 10_000_000u128 {
- format!("{} ms", t / 1_000u128)
+ format!("{:.2} ms", t as f64 / 1e3f64)
} else {
- format!("{} s", t / 1_000_000u128)
+ format!("{:.2} s", t as f64 / 1e6f64)
}
}