config: set benchmark timer at right point

This commit is contained in:
Mitchell Hashimoto 2014-05-23 22:11:33 -07:00
parent 5bb51e50dd
commit 1c9582ff38
1 changed files with 2 additions and 1 deletions

View File

@ -7,8 +7,9 @@ import (
func BenchmarkVariableDetectWalker(b *testing.B) {
w := new(variableDetectWalker)
str := reflect.ValueOf(`foo ${var.bar} bar ${bar.baz.bing} $${escaped}`)
b.ResetTimer()
for i := 0; i < b.N; i++ {
w.Variables = nil
w.Primitive(str)