diff --git a/parser/execute_test.go b/parser/execute_test.go index b6a9dfb..0376591 100644 --- a/parser/execute_test.go +++ b/parser/execute_test.go @@ -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) diff --git a/parser/tokenise_test.go b/parser/tokenise_test.go index 7ae7c27..0c1f34d 100644 --- a/parser/tokenise_test.go +++ b/parser/tokenise_test.go @@ -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) - } }