Skip to content

Commit 5cde95a

Browse files
committed
v.util: measure more precisely how long a new tool recompilation lasts in launch_tool, when using v -d trace_launch_tool self
1 parent d798e3c commit 5cde95a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vlib/v/util/util.v

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) {
161161
tlog('looping i: ${i} / ${tool_recompile_retry_max_count}')
162162
// ensure a stable and known working folder, when compiling V's tools, to avoid module lookup problems:
163163
os.chdir(vroot) or {}
164+
compile_sw := time.new_stopwatch()
164165
tool_compilation := os.execute(compilation_command)
165166
os.chdir(current_work_dir) or {}
166-
tlog('tool_compilation.exit_code: ${tool_compilation.exit_code}')
167+
tlog('tool_compilation.exit_code: ${tool_compilation.exit_code}, took: ${compile_sw.elapsed().milliseconds()}ms')
167168
if tool_compilation.exit_code == 0 {
168169
break
169170
} else {

0 commit comments

Comments
 (0)