As Michael Jones said, you still need to play by the testing package's benchmark rules for it to be able to benchmark your code.
So something along these lines. func BenchmarkMarshalSample(b *testing.B) { for i:=0; i < b.N; i++ { var sum int64 // start := time.Now() for i := 0; i < 10_000_000; i++ { sum += rand.Int63n(0xFFFFFFFF) } // b.Logf("Sum %e Duration %v", float64(sum), time.Now().Sub(start)) } } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/36e51c75-6571-41df-b829-038d284c44bd%40googlegroups.com.