-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_test.go
More file actions
29 lines (23 loc) · 978 Bytes
/
Copy pathrandom_test.go
File metadata and controls
29 lines (23 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package random
import "testing"
var intsRes []int
func BenchmarkIntsHundred(b *testing.B) { benchmarkIntsI(100, b) }
func BenchmarkIntsThousand(b *testing.B) { benchmarkIntsI(1000, b) }
func BenchmarkIntsLakh(b *testing.B) { benchmarkIntsI(100000, b) }
func BenchmarkIntsMillion(b *testing.B) { benchmarkIntsI(1000000, b) }
func BenchmarkIntsBillion(b *testing.B) { benchmarkIntsI(1000000000, b) }
func benchmarkIntsI(i int, b *testing.B) {
for n := 0; n < b.N; n++ {
intsRes = Ints(i)
}
}
func BenchmarkIntsnHundred(b *testing.B) { benchmarkIntsnI(100, b) }
func BenchmarkIntsnThousand(b *testing.B) { benchmarkIntsnI(1000, b) }
func BenchmarkIntsnLakh(b *testing.B) { benchmarkIntsnI(100000, b) }
func BenchmarkIntsnMillion(b *testing.B) { benchmarkIntsnI(1000000, b) }
func BenchmarkIntsnBillion(b *testing.B) { benchmarkIntsnI(1000000000, b) }
func benchmarkIntsnI(i int, b *testing.B) {
for n := 0; n < b.N; n++ {
intsRes = Intsn(i, 100000)
}
}