github.com/detailyang/fastrand-go@v0.0.0-20191106153122-53093851e761/fastrand_bench_test.go (about)

     1  package fastrand
     2  
     3  import (
     4  	"math/rand"
     5  	"testing"
     6  )
     7  
     8  func BenchmarkFastRand(b *testing.B) {
     9  	for i := 0; i < b.N; i++ {
    10  		j := FastRand()
    11  		_ = j
    12  	}
    13  }
    14  
    15  func BenchmarkMathRand(b *testing.B) {
    16  	for i := 0; i < b.N; i++ {
    17  		rand.Int()
    18  	}
    19  }