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