Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for benchFunc (0.43 sec)

  1. src/testing/benchmark.go

    	// by clearing garbage from previous runs.
    	runtime.GC()
    	b.resetRaces()
    	b.N = n
    	b.parallelism = 1
    	b.ResetTimer()
    	b.StartTimer()
    	b.benchFunc(b)
    	b.StopTimer()
    	b.previousN = n
    	b.previousDuration = b.duration
    }
    
    // run1 runs the first iteration of benchFunc. It reports whether more
    // iterations of this benchmarks should be run.
    func (b *B) run1() bool {
    	if ctx := b.context; ctx != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  2. src/strings/strings_test.go

    		(indexSizes[len(indexSizes)-1]+len(benchmarkString)-1)/len(benchmarkString))
    	benchFunc := func(b *testing.B, benchStr string) {
    		b.SetBytes(int64(len(benchStr)))
    		for i := 0; i < b.N; i++ {
    			Count(benchStr, "=")
    		}
    	}
    	for _, size := range indexSizes {
    		b.Run(fmt.Sprintf("%d", size), func(b *testing.B) {
    			benchFunc(b, benchStr[:size])
    		})
    	}
    
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 12:58:37 UTC 2024
    - 53K bytes
    - Viewed (0)
Back to top