github.com/coocood/rtutil@v0.0.0-20190304133409-c84515f646f2/rtutil_test.go (about) 1 package rtutil 2 3 import ( 4 "testing" 5 ) 6 7 func BenchmarkAESHash(b *testing.B) { 8 buf := make([]byte, 64) 9 for i := 0; i < b.N; i++ { 10 AESHash(buf) 11 } 12 } 13 14 func BenchmarkNanoTime(b *testing.B) { 15 for i := 0; i < b.N; i++ { 16 NanoTime() 17 } 18 } 19 20 func BenchmarkCPUTicks(b *testing.B) { 21 for i := 0; i < b.N; i++ { 22 CPUTicks() 23 } 24 } 25 26 func BenchmarkFastRand(b *testing.B) { 27 for i := 0; i < b.N; i++ { 28 FastRand() 29 } 30 }