LEFT | RIGHT |
(Both sides are equal) |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package runtime_test | 5 package runtime_test |
6 | 6 |
7 import ( | 7 import ( |
8 "runtime" | 8 "runtime" |
9 "sync" | 9 "sync" |
10 "sync/atomic" | 10 "sync/atomic" |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 func BenchmarkChanSem(b *testing.B) { | 782 func BenchmarkChanSem(b *testing.B) { |
783 type Empty struct{} | 783 type Empty struct{} |
784 myc := make(chan Empty, runtime.GOMAXPROCS(0)) | 784 myc := make(chan Empty, runtime.GOMAXPROCS(0)) |
785 b.RunParallel(func(pb *testing.PB) { | 785 b.RunParallel(func(pb *testing.PB) { |
786 for pb.Next() { | 786 for pb.Next() { |
787 myc <- Empty{} | 787 myc <- Empty{} |
788 <-myc | 788 <-myc |
789 } | 789 } |
790 }) | 790 }) |
791 } | 791 } |
LEFT | RIGHT |