Commit a8ed75d2 authored by Roger Peppe's avatar Roger Peppe Committed by Russ Cox

added benchmarks to rand_test.go;

removed superfluous field name in lockedSource.

R=r, rsc
https://golang.org/cl/170043
parent 51f29320
......@@ -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()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment