Skip to content

Commit

Permalink
Reset benchmark timer after setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmorgan committed May 30, 2024
1 parent ea3a46d commit e5ae801
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions parser/execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func BenchmarkExecute(b *testing.B) {
inputBuf := bufio.NewReader(strings.NewReader("80\n"))
outputBuf := bufio.NewWriter(&bufferWriter{})
program, _ := Tokenise(buff)
b.ResetTimer()
for i := 0; i < b.N; i++ {
startdata := make([]int, 65536)
Execute(startdata, program, inputBuf, outputBuf)
Expand Down
2 changes: 1 addition & 1 deletion parser/tokenise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ func BenchmarkTokenise(b *testing.B) {
b.Errorf("error opening program: err:")
}
buff := bufio.NewReader(sourceFile)
b.ResetTimer()
for i := 0; i < b.N; i++ {
Tokenise(buff)

}
}

0 comments on commit e5ae801

Please sign in to comment.