Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for cpuHog (0.15 sec)

  1. src/runtime/pprof/pprof_test.go

    // otherwise under race detector the samples will be in the race runtime.
    func cpuHog1(x int) int {
    	return cpuHog0(x, 1e5)
    }
    
    func cpuHog0(x, n int) int {
    	foo := x
    	for i := 0; i < n; i++ {
    		if foo > 0 {
    			foo *= foo
    		} else {
    			foo *= foo + 1
    		}
    	}
    	return foo
    }
    
    func cpuHog2(x int) int {
    	foo := x
    	for i := 0; i < 1e5; i++ {
    		if foo > 0 {
    			foo *= foo
    		} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 68.8K bytes
    - Viewed (0)
Back to top