MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / RequestDuration

Function RequestDuration

server/timer.go:23–28  ·  view source on GitHub ↗

RequestDuration returns the duration since the timer started in the context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

21
22// RequestDuration returns the duration since the timer started in the context.
23func RequestDuration(ctx context.Context) time.Duration {
24 if t, ok := ctx.Value(timerSinceCtxKey{}).(time.Time); ok {
25 return time.Since(t)
26 }
27 return 0
28}
29
30// CheckTimeout checks if the request context has timed out or cancelled and returns
31// wrapped error.

Callers 2

LogResponseFunction · 0.85
CheckTimeoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected