Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for BenchmarkCas64 (0.14 sec)

  1. src/internal/runtime/atomic/bench_test.go

    	var x uint32
    	x = 1
    	ptr := &x
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			atomic.Cas(ptr, 1, 0)
    			atomic.Cas(ptr, 0, 1)
    		}
    	})
    }
    
    func BenchmarkCas64(b *testing.B) {
    	var x uint64
    	x = 1
    	ptr := &x
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			atomic.Cas64(ptr, 1, 0)
    			atomic.Cas64(ptr, 0, 1)
    		}
    	})
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top