added benchmarks to rand_test.go;
removed superfluous field name in lockedSource.
R=r, rsc
https://golang.org/cl/170043
diff --git a/src/pkg/rand/rand_test.go b/src/pkg/rand/rand_test.go
index ae417a9..e0d1da4 100644
--- a/src/pkg/rand/rand_test.go
+++ b/src/pkg/rand/rand_test.go
@@ -312,3 +312,18 @@
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()
+ }
+}