1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v,gen,checker: implement -d time_checking -d time_cgening -d time_v

This commit is contained in:
Delyan Angelov
2020-12-19 12:24:29 +02:00
parent a4aa9c0320
commit a1c81aa49d
5 changed files with 35 additions and 3 deletions

View File

@@ -31,13 +31,13 @@ pub fn (mut t Timers) measure(name string) i64 {
eprintln('> Available timers:')
eprintln('> $timer_keys')
}
ms := t.swatches[name].elapsed().milliseconds()
ms := t.swatches[name].elapsed().microseconds()
return ms
}
pub fn (mut t Timers) message(name string) string {
ms := t.measure(name)
value := bold('$ms')
ms := f64(t.measure(name)) / 1000.0
value := bold('${ms:.3f}')
formatted_message := '$name: $value ms'
return formatted_message
}