From e11c23a8176f98dc48f0d890d99241066342994b Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 21 Jul 2019 19:42:51 +0200 Subject: [PATCH] main.v: print how much time cc() took; more flags explained --- compiler/main.v | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/compiler/main.v b/compiler/main.v index 1181403824..1faf8efd6e 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -643,12 +643,17 @@ mut args := '' $if windows { cmd = 'gcc $args' } + // Run + ticks := time.ticks() + res := os.exec(cmd) + diff := time.ticks() - ticks // Print the C command if v.pref.show_c_cmd || v.pref.is_verbose { - println('\n==========\n$cmd\n=========\n') + println('\n==========') + println(cmd) + println('cc took $diff ms') + println('=========\n') } - // Run - res := os.exec(cmd) // println('C OUTPUT:') if res.contains('error: ') { println(res) @@ -1124,10 +1129,13 @@ Options: -prod Build an optimized executable. -o Place output into . -obf Obfuscate the resulting binary. - -show_c_cmd Print the full C compilation command. + -show_c_cmd Print the full C compilation command and how much time it took. -debug Leave a C file for debugging in .program.c. + -live Enable hot code reloading (required by functions marked with [live]). + fmt Run vfmt to format the source code. run Build and execute a V program. You can add arguments after the file name. + Files: _test.v Test file. '