Example #1
0
func main() {
	start := time.Now()
	d := gen_rand.GenRand(mio)
	fmt.Println("c ", d, " Dur ", time.Since(start))

	numCPU := runtime.NumCPU()
	fmt.Println("numCPU ", numCPU)

	runtime.GOMAXPROCS(numCPU)
	maxProcs := runtime.GOMAXPROCS(0)
	fmt.Println("maxProcs ", maxProcs)

	runtime.GOMAXPROCS(numCPU)

	start = time.Now()
	gen_rand.GenRandGo(mio, numCPU)
	fmt.Println("c ", d, " Dur ", time.Since(start))
}
func TestGenRand(t *testing.T) {
	if gen_rand.GenRand(0) < 0 {
		t.Errorf("fail")
	}
}
func genRand(i int, b *testing.B) {
	for n := 0; n < b.N; n++ {
		gen_rand.GenRand(i)
	}
}