mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
repl: add some timing statistics when running REPL test files
This commit is contained in:

committed by
Alexander Medvednikov

parent
d4a30d022b
commit
35f927e64e
19
compiler/tests/repl/run.v
Normal file
19
compiler/tests/repl/run.v
Normal file
@ -0,0 +1,19 @@
|
||||
module main
|
||||
|
||||
import compiler.tests.repl.runner
|
||||
import log
|
||||
|
||||
fn main(){
|
||||
logger := &log.Log{log.DEBUG, 'terminal'}
|
||||
options := runner.new_options()
|
||||
global_start_time := runner.now()
|
||||
for file in options.files {
|
||||
stime := runner.now()
|
||||
fres := runner.run_repl_file(options.wd, options.vexec, file) or {
|
||||
logger.error( runner.tdiff_in_ms(err, stime) )
|
||||
continue
|
||||
}
|
||||
logger.info( runner.tdiff_in_ms(fres, stime) )
|
||||
}
|
||||
logger.info( runner.tdiff_in_ms('<=== total time spent running REPL files', global_start_time) )
|
||||
}
|
Reference in New Issue
Block a user