parent
ff42572e93
commit
14f45bb8ef
|
@ -110,7 +110,19 @@ fn measure(cmd string, description string) int {
|
||||||
exec(cmd)
|
exec(cmd)
|
||||||
}
|
}
|
||||||
println(' Building...')
|
println(' Building...')
|
||||||
sw := time.new_stopwatch({})
|
mut runs := []int{}
|
||||||
exec(cmd)
|
for r in 0 .. 5 {
|
||||||
return int(sw.elapsed().milliseconds())
|
println(' Sample ${r+1}/5')
|
||||||
|
sw := time.new_stopwatch({})
|
||||||
|
exec(cmd)
|
||||||
|
runs << int(sw.elapsed().milliseconds())
|
||||||
|
}
|
||||||
|
// discard lowest and highest time
|
||||||
|
runs.sort()
|
||||||
|
runs = runs[1..4]
|
||||||
|
mut sum := 0
|
||||||
|
for run in runs {
|
||||||
|
sum += run
|
||||||
|
}
|
||||||
|
return int(sum / 3)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue