summaryrefslogtreecommitdiff
path: root/libgo/go/crypto/rand/util_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/crypto/rand/util_test.go')
-rw-r--r--libgo/go/crypto/rand/util_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/libgo/go/crypto/rand/util_test.go b/libgo/go/crypto/rand/util_test.go
index 7b076896767..48a2c3fc0cb 100644
--- a/libgo/go/crypto/rand/util_test.go
+++ b/libgo/go/crypto/rand/util_test.go
@@ -7,7 +7,9 @@ package rand_test
import (
"crypto/rand"
"math/big"
+ mathrand "math/rand"
"testing"
+ "time"
)
// https://golang.org/issue/6849.
@@ -63,3 +65,10 @@ func TestIntNegativeMaxPanics(t *testing.T) {
b := new(big.Int).SetInt64(int64(-1))
testIntPanics(t, b)
}
+
+func BenchmarkPrime(b *testing.B) {
+ r := mathrand.New(mathrand.NewSource(time.Now().UnixNano()))
+ for i := 0; i < b.N; i++ {
+ rand.Prime(r, 1024)
+ }
+}