mirror of
https://github.com/golang/go.git
synced 2025-05-29 03:11:26 +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
@ -312,3 +312,18 @@ func TestExpTables(t *testing.T) {
|
|||||||
t.Errorf("fe disagrees at index %v; %v != %v\n", i, fe[i], testFe[i])
|
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…
x
Reference in New Issue
Block a user