Ejemplo n.º 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))
}
Ejemplo n.º 2
0
func genRandGo(i, g int, b *testing.B) {
	for n := 0; n < b.N; n++ {
		gen_rand.GenRandGo(i, g)
	}
}
Ejemplo n.º 3
0
func GenRandGo(t *testing.T) {
	if gen_rand.GenRandGo(0, 0) < 0 {
		t.Errorf("fail")
	}
}