代码拉取完成,页面将自动刷新
同步操作将从 dromara/carbon 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
package carbon
import (
"testing"
"time"
)
func BenchmarkCreateFromStdTime(b *testing.B) {
now := time.Now().In(time.Local)
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromStdTime(now)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromStdTime(now, PRC)
}
})
}
func BenchmarkCreateFromTimestamp(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestamp(1649735755)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestamp(1649735755, PRC)
}
})
}
func BenchmarkCreateFromTimestampMilli(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestampMilli(1649735755)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestampMilli(1649735755, PRC)
}
})
}
func BenchmarkCreateFromTimestampMicro(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestampMicro(1649735755)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestampMicro(1649735755, PRC)
}
})
}
func BenchmarkCreateFromTimestampNano(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestampNano(1649735755)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimestampNano(1649735755, PRC)
}
})
}
func BenchmarkCreateFromDateTime(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTime(2020, 8, 5, 13, 14, 15)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTime(2020, 8, 5, 13, 14, 15, PRC)
}
})
}
func BenchmarkCreateFromDateTimeMilli(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTimeMilli(2020, 8, 5, 13, 14, 15, 999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTimeMilli(2020, 8, 5, 13, 14, 15, 999, PRC)
}
})
}
func BenchmarkCreateFromDateTimeMicro(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTimeMicro(2020, 8, 5, 13, 14, 15, 999999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTimeMicro(2020, 8, 5, 13, 14, 15, 999999, PRC)
}
})
}
func BenchmarkCreateFromDateTimeNano(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTimeNano(2020, 8, 5, 13, 14, 15, 999999999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateTimeNano(2020, 8, 5, 13, 14, 15, 999999999, PRC)
}
})
}
func BenchmarkCreateFromDate(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDate(2020, 8, 5)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDate(2020, 8, 5, PRC)
}
})
}
func BenchmarkCreateFromDateMilli(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateMilli(2020, 8, 5, 999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateMilli(2020, 8, 5, 999, PRC)
}
})
}
func BenchmarkCreateFromDateMicro(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateMicro(2020, 8, 5, 999999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateMicro(2020, 8, 5, 999999, PRC)
}
})
}
func BenchmarkCreateFromDateNano(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateNano(2020, 8, 5, 999999999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromDateNano(2020, 8, 5, 999999999, PRC)
}
})
}
func BenchmarkCreateFromTime(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTime(13, 14, 15)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTime(13, 14, 15, PRC)
}
})
}
func BenchmarkCreateFromTimeMilli(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimeMilli(13, 14, 15, 999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimeMilli(13, 14, 15, 999, PRC)
}
})
}
func BenchmarkCreateFromTimeMicro(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimeMicro(13, 14, 15, 999999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimeMicro(13, 14, 15, 999999, PRC)
}
})
}
func BenchmarkCreateFromTimeNano(b *testing.B) {
b.Run("without timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimeNano(13, 14, 15, 999999999)
}
})
b.Run("with timezone", func(b *testing.B) {
b.ResetTimer()
for n := 0; n < b.N; n++ {
CreateFromTimeNano(13, 14, 15, 999999999, PRC)
}
})
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。