forked from dromara/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
creator_bench_test.go
executable file
·108 lines (90 loc) · 2.23 KB
/
creator_bench_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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package carbon
import (
"testing"
"time"
)
func BenchmarkCarbon_CreateFromStdTime(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromStdTime(time.Now())
}
}
func BenchmarkCarbon_CreateFromTimestamp(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTimestamp(1649735755)
}
}
func BenchmarkCarbon_CreateFromTimestampMilli(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTimestampMilli(1649735755981)
}
}
func BenchmarkCarbon_CreateFromTimestampMicro(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTimestampMicro(1649735755981566)
}
}
func BenchmarkCarbon_CreateFromTimestampNano(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTimestampNano(1649735755981566000)
}
}
func BenchmarkCarbon_CreateFromDateTime(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDateTime(2020, 8, 5, 13, 14, 15)
}
}
func BenchmarkCarbon_CreateFromDateTimeMilli(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDateTimeMilli(2020, 8, 5, 13, 14, 15, 0)
}
}
func BenchmarkCarbon_CreateFromDateTimeMicro(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDateTimeMicro(2020, 8, 5, 13, 14, 15, 0)
}
}
func BenchmarkCarbon_CreateFromDateTimeNano(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDateTimeNano(2020, 8, 5, 13, 14, 15, 0)
}
}
func BenchmarkCarbon_CreateFromDate(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDate(2020, 8, 5)
}
}
func BenchmarkCarbon_CreateFromDateMilli(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDateMilli(2020, 8, 5, 0)
}
}
func BenchmarkCarbon_CreateFromDateMicro(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDateMicro(2020, 8, 5, 0)
}
}
func BenchmarkCarbon_CreateFromDateNano(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromDateNano(2020, 8, 5, 0)
}
}
func BenchmarkCarbon_CreateFromTime(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTime(13, 14, 15)
}
}
func BenchmarkCarbon_CreateFromTimeMilli(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTimeMilli(13, 14, 15, 0)
}
}
func BenchmarkCarbon_CreateFromTimeMicro(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTimeMicro(13, 14, 15, 0)
}
}
func BenchmarkCarbon_CreateFromTimeNano(b *testing.B) {
for n := 0; n < b.N; n++ {
CreateFromTimeNano(13, 14, 15, 0)
}
}