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:
@@ -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.
|
||||
|
||||
@@ -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'] {
|
||||
|
||||
Reference in New Issue
Block a user