parser: support for `-d time_parsing`
parent
7e1e247f56
commit
6f7889a3ca
|
@ -267,6 +267,10 @@ fn (mut q Queue) run() {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
pub fn parse_files(paths []string, table &table.Table, pref &pref.Preferences, global_scope &ast.Scope) []ast.File {
|
pub fn parse_files(paths []string, table &table.Table, pref &pref.Preferences, global_scope &ast.Scope) []ast.File {
|
||||||
|
mut timers := util.new_timers(false)
|
||||||
|
$if time_parsing ? {
|
||||||
|
timers.should_print = true
|
||||||
|
}
|
||||||
// println('nr_cpus= $nr_cpus')
|
// println('nr_cpus= $nr_cpus')
|
||||||
$if macos {
|
$if macos {
|
||||||
/*
|
/*
|
||||||
|
@ -300,7 +304,9 @@ pub fn parse_files(paths []string, table &table.Table, pref &pref.Preferences, g
|
||||||
mut files := []ast.File{}
|
mut files := []ast.File{}
|
||||||
for path in paths {
|
for path in paths {
|
||||||
// println('parse_files $path')
|
// println('parse_files $path')
|
||||||
|
timers.start('parse_file $path')
|
||||||
files << parse_file(path, table, .skip_comments, pref, global_scope)
|
files << parse_file(path, table, .skip_comments, pref, global_scope)
|
||||||
|
timers.show('parse_file $path')
|
||||||
}
|
}
|
||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import time
|
||||||
|
|
||||||
[ref_only]
|
[ref_only]
|
||||||
pub struct Timers {
|
pub struct Timers {
|
||||||
mut:
|
pub mut:
|
||||||
swatches map[string]time.StopWatch
|
swatches map[string]time.StopWatch
|
||||||
should_print bool
|
should_print bool
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue