diff options
author | Roger Peppe <rogpeppe@gmail.com> | 2009-12-09 14:23:43 -0800 |
---|---|---|
committer | Roger Peppe <rogpeppe@gmail.com> | 2009-12-09 14:23:43 -0800 |
commit | 6aca6bc330a726dfcf129ce823695eebf5519536 (patch) | |
tree | 17e4bcbef7622bead76b22dcafa860dde61994ec /src/pkg/rand | |
parent | 642a169746796701b79e4110a460bdf56c2e9343 (diff) | |
download | golang-6aca6bc330a726dfcf129ce823695eebf5519536.tar.gz |
added benchmarks to rand_test.go;
removed superfluous field name in lockedSource.
R=r, rsc
http://codereview.appspot.com/170043
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/rand')
-rw-r--r-- | src/pkg/rand/rand_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pkg/rand/rand_test.go b/src/pkg/rand/rand_test.go index ae417a9be..e0d1da4bb 100644 --- a/src/pkg/rand/rand_test.go +++ b/src/pkg/rand/rand_test.go @@ -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() + } +} |