mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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
1 changed files with 15 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue