Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for BenchmarkConcurrent (0.56 sec)

  1. src/log/log_test.go

    // but copied here to avoid the io.Discard optimization in Logger.
    type discard struct{}
    
    func (discard) Write(p []byte) (int, error) {
    	return len(p), nil
    }
    
    func BenchmarkConcurrent(b *testing.B) {
    	l := New(discard{}, "prefix: ", Ldate|Ltime|Lmicroseconds|Llongfile|Lmsgprefix)
    	var group sync.WaitGroup
    	for i := runtime.NumCPU(); i > 0; i-- {
    		group.Add(1)
    		go func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 21 20:04:37 UTC 2023
    - 7.4K bytes
    - Viewed (0)
  2. src/math/rand/rand_test.go

    	}
    }
    
    func BenchmarkRead1000(b *testing.B) {
    	r := New(NewSource(1))
    	buf := make([]byte, 1000)
    	b.ResetTimer()
    	for n := b.N; n > 0; n-- {
    		r.Read(buf)
    	}
    }
    
    func BenchmarkConcurrent(b *testing.B) {
    	const goroutines = 4
    	var wg sync.WaitGroup
    	wg.Add(goroutines)
    	for i := 0; i < goroutines; i++ {
    		go func() {
    			defer wg.Done()
    			for n := b.N; n > 0; n-- {
    				Int63()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 16.9K bytes
    - Viewed (0)
  3. src/math/rand/v2/rand_test.go

    	r := testRand()
    	for n := b.N; n > 0; n-- {
    		r.Shuffle(30, func(i, j int) {
    			if i < 0 || i >= 30 || j < 0 || j >= 30 {
    				b.Fatalf("bad swap(%d, %d)", i, j)
    			}
    		})
    	}
    }
    
    func BenchmarkConcurrent(b *testing.B) {
    	const goroutines = 4
    	var wg sync.WaitGroup
    	wg.Add(goroutines)
    	for i := 0; i < goroutines; i++ {
    		go func() {
    			defer wg.Done()
    			for n := b.N; n > 0; n-- {
    				Int64()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 17.4K bytes
    - Viewed (0)
Back to top