1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builder: use time.new_stopwatch instead of benchmark.new_benchmark (reduces exe size)

This commit is contained in:
Delyan Angelov 2020-05-05 15:31:23 +03:00
parent ee92060d4d
commit a3bc32f3e0

View File

@ -3,7 +3,7 @@
// that can be found in the LICENSE file.
module builder
import benchmark
import time
import os
import v.pref
import v.util
@ -31,15 +31,14 @@ pub fn compile(command string, pref &pref.Preferences) {
println('builder.compile() pref:')
// println(pref)
}
mut tmark := benchmark.new_benchmark()
mut sw := time.new_stopwatch()
match pref.backend {
.c { b.compile_c() }
.js { b.compile_js() }
.x64 { b.compile_x64() }
}
if pref.is_stats {
tmark.stop()
println('compilation took: ' + tmark.total_duration().str() + 'ms')
println('compilation took: ${sw.elapsed().milliseconds()} ms')
}
if pref.is_test || pref.is_run {
b.run_compiled_executable_and_exit()