mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: move timing_start/timing_measure to util.timing_start/util.timing_measure
This commit is contained in:
@@ -19,6 +19,25 @@ pub fn new_timers(should_print bool) &Timers {
|
||||
}
|
||||
}
|
||||
|
||||
const timers = new_timers(false)
|
||||
|
||||
pub fn get_timers() &Timers {
|
||||
return util.timers
|
||||
}
|
||||
|
||||
pub fn timing_start(label string) {
|
||||
get_timers().start(label)
|
||||
}
|
||||
|
||||
pub fn timing_measure(label string) {
|
||||
get_timers().show(label)
|
||||
}
|
||||
|
||||
pub fn timing_set_should_print(should_print bool) {
|
||||
mut t := util.timers
|
||||
t.should_print = should_print
|
||||
}
|
||||
|
||||
pub fn (mut t Timers) start(name string) {
|
||||
sw := time.new_stopwatch({})
|
||||
t.swatches[name] = sw
|
||||
|
||||
Reference in New Issue
Block a user