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

@@ -118,6 +118,12 @@ The build flags are shared by the build and run commands:
CHECK: 62ms
C GEN: 103ms
C tcc: 95ms
Related to -show-timings, is the ability to compile a special instrumented
v compiler with this command:
`v -d time_parsing -d time_checking -d time_cgening -d time_v self`
The instrumented version will print detailed timing stats while processing
each .v file.
-w
Hide all warnings.

View File

@@ -37,6 +37,14 @@ const (
)
fn main() {
timers_should_print := $if time_v ? { true } $else { false }
mut timers := util.new_timers(timers_should_print)
timers.start('v total')
defer {
timers.show('v total')
}
timers.start('v start')
timers.show('v start')
args := os.args[1..]
// args = 123
if args.len == 0 || args[0] in ['-', 'repl'] {