MCPcopy Create free account
hub / github.com/imroc/req / TotalTime

Method TotalTime

response.go:132–140  ·  view source on GitHub ↗

TotalTime returns the total time of the request, from request we sent to response we received.

()

Source from the content-addressed store, hash-verified

130
131// TotalTime returns the total time of the request, from request we sent to response we received.
132func (r *Response) TotalTime() time.Duration {
133 if r.Request.trace != nil {
134 return r.Request.TraceInfo().TotalTime
135 }
136 if !r.receivedAt.IsZero() {
137 return r.receivedAt.Sub(r.Request.StartTime)
138 }
139 return r.Request.responseReturnTime.Sub(r.Request.StartTime)
140}
141
142// ReceivedAt returns the timestamp that response we received.
143func (r *Response) ReceivedAt() time.Time {

Callers 2

assertTraceInfoFunction · 0.80
TestTraceOnTimeoutFunction · 0.80

Calls 2

IsZeroMethod · 0.80
TraceInfoMethod · 0.45

Tested by 2

assertTraceInfoFunction · 0.64
TestTraceOnTimeoutFunction · 0.64