-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbenchmark_test.go
69 lines (55 loc) · 902 Bytes
/
benchmark_test.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Package locale implements functions to retrieve the current locale(s)
// of the operating system.
package locale
import (
"testing"
)
var (
result string
results []string
e error
)
func BenchmarkGetLocale(b *testing.B) {
var (
locale string
err error
)
for n := 0; n < b.N; n++ {
locale, err = GetLocale()
}
result = locale
e = err
}
func BenchmarkGetLocales(b *testing.B) {
var (
locales []string
err error
)
for n := 0; n < b.N; n++ {
locales, err = GetLocales()
}
results = locales
e = err
}
func BenchmarkGetLanguage(b *testing.B) {
var (
language string
err error
)
for n := 0; n < b.N; n++ {
language, err = GetLanguage()
}
result = language
e = err
}
func BenchmarkGetRegion(b *testing.B) {
var (
region string
err error
)
for n := 0; n < b.N; n++ {
region, err = GetRegion()
}
result = region
e = err
}