2 Star 0 Fork 70

golang-package/carbon

forked from dromara/carbon 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
default_bench_test.go 451 Bytes
一键复制 编辑 原始数据 按行查看 历史
kuafuRace 提交于 2个月前 . test: Add b.ResetTimer()
package carbon
import (
"testing"
)
func BenchmarkSetDefault(b *testing.B) {
defer ResetDefault()
d := Default{
Layout: DateTimeLayout,
Timezone: PRC,
Locale: "zh-CN",
WeekStartsAt: Monday,
WeekendDays: []Weekday{
Saturday, Sunday,
},
}
b.ResetTimer()
for n := 0; n < b.N; n++ {
SetDefault(d)
}
}
func BenchmarkResetDefault(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
ResetDefault()
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/golang-package/carbon.git
git@gitee.com:golang-package/carbon.git
golang-package
carbon
carbon
master

搜索帮助