package main import ( "testing" ) //Namenskonvention: Benchmark… func BenchmarkMeineIrgendwieBenannteTestingFunction(b *testing.B) { //maxThreads = int8(runtime.NumCPU()) //maxRoutines = maxThreads * ThreadFaktor //runtime.GOMAXPROCS(int(maxThreads)) testzahl := [...]int{5769977777, 8978793242417717171, 8978793242417717169, 11, 8} for i := 0; i < b.N; i++ { for j := range testzahl { _ = is_prime(&j) } } } /* Siehe auch Profiling: $ go test -cpuprofile cpu.prof -memprofile mem.prof -bench . $ go tool pprof cpu.prof Entering interactive mode (type "help" for commands) (pprof) png > Schaubild.png (pprof) weblist (pprof) help */