MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestFastTime_UnixFloor

Function TestFastTime_UnixFloor

internal/utils/fasttime/time_fast_test.go:24–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func TestFastTime_UnixFloor(t *testing.T) {
25 var now = fasttime.Now()
26
27 var timestamp = time.Now().Unix()
28 t.Log("floor 60:", timestamp, now.UnixFloor(60), timeutil.FormatTime("Y-m-d H:i:s", now.UnixFloor(60)))
29 t.Log("ceil 60:", timestamp, now.UnixCell(60), timeutil.FormatTime("Y-m-d H:i:s", now.UnixCell(60)))
30 t.Log("floor 300:", timestamp, now.UnixFloor(300), timeutil.FormatTime("Y-m-d H:i:s", now.UnixFloor(300)))
31 t.Log("next minute:", now.UnixNextMinute(), timeutil.FormatTime("Y-m-d H:i:s", now.UnixNextMinute()))
32 t.Log("day:", now.Ymd())
33 t.Log("round 5 minute:", now.Round5Hi())
34}
35
36func TestFastTime_Format(t *testing.T) {
37 var now = fasttime.Now()

Callers

nothing calls this directly

Calls 8

NowFunction · 0.92
UnixMethod · 0.80
LogMethod · 0.80
UnixFloorMethod · 0.80
UnixCellMethod · 0.80
UnixNextMinuteMethod · 0.80
YmdMethod · 0.80
Round5HiMethod · 0.80

Tested by

no test coverage detected