tools/fast: fix unused var, use Stopwatch, .gitignore

pull/4877/head
JalonSolov 2020-05-12 19:55:33 -04:00 committed by GitHub
parent af334e320c
commit 5f7a8df885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,5 @@
fast
v2
index.html
table.html
v.c
v2

View File

@ -76,11 +76,11 @@ fn exec(s string) string {
// returns milliseconds
fn measure(cmd string) int {
println('Warming up...')
for i in 0..3 {
for _ in 0..3 {
exec(cmd)
}
println('Building...')
ticks := time.ticks()
sw := time.new_stopwatch()
exec(cmd)
return int(time.ticks() - ticks)
return int(sw.elapsed().milliseconds())
}