MCPcopy
hub / github.com/redis/go-redis / formatMs

Function formatMs

commands.go:29–39  ·  view source on GitHub ↗
(ctx context.Context, dur time.Duration)

Source from the content-addressed store, hash-verified

27}
28
29func formatMs(ctx context.Context, dur time.Duration) int64 {
30 if dur > 0 && dur < time.Millisecond {
31 internal.Logger.Printf(
32 ctx,
33 "specified duration is %s, but minimal supported value is %s - truncating to 1ms",
34 dur, time.Millisecond,
35 )
36 return 1
37 }
38 return int64(dur / time.Millisecond)
39}
40
41func formatSec(ctx context.Context, dur time.Duration) int64 {
42 if dur > 0 && dur < time.Second {

Callers 15

ClientPauseMethod · 0.85
HPExpireMethod · 0.85
HPExpireWithArgsMethod · 0.85
MigrateMethod · 0.85
PExpireMethod · 0.85
RestoreMethod · 0.85
RestoreReplaceMethod · 0.85
XPendingExtMethod · 0.85
xAutoClaimArgsFunction · 0.85
GetExMethod · 0.85
SetMethod · 0.85
SetArgsMethod · 0.85

Calls 1

PrintfMethod · 0.65

Tested by

no test coverage detected