mirror of
https://github.com/golang/go
synced 2024-11-20 05:04:43 -07:00
added benchmarks to rand_test.go;
removed superfluous field name in lockedSource. R=r, rsc https://golang.org/cl/170043
This commit is contained in:
parent
51f2932082
commit
a8ed75d27c
@ -312,3 +312,18 @@ func TestExpTables(t *testing.T) {
|
||||
t.Errorf("fe disagrees at index %v; %v != %v\n", i, fe[i], testFe[i])
|
||||
}
|
||||
}
|
||||
|
||||
// Benchmarks
|
||||
|
||||
func BenchmarkInt63Threadsafe(b *testing.B) {
|
||||
for n := b.N; n > 0; n-- {
|
||||
Int63()
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkInt63Unthreadsafe(b *testing.B) {
|
||||
r := New(NewSource(1));
|
||||
for n := b.N; n > 0; n-- {
|
||||
r.Int63()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user