1
0
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:
Roger Peppe 2009-12-09 14:23:43 -08:00 committed by Russ Cox
parent 51f2932082
commit a8ed75d27c

View File

@ -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()
}
}