MCPcopy Create free account
hub / github.com/github/gh-aw / timeBetween

Function timeBetween

pkg/cli/outcome_eval.go:290–297  ·  view source on GitHub ↗

timeBetween computes hours between two ISO timestamps.

(from, to string)

Source from the content-addressed store, hash-verified

288
289// timeBetween computes hours between two ISO timestamps.
290func timeBetween(from, to string) float64 {
291 t1, err1 := time.Parse(time.RFC3339, from)
292 t2, err2 := time.Parse(time.RFC3339, to)
293 if err1 != nil || err2 != nil {
294 return 0
295 }
296 return t2.Sub(t1).Hours()
297}
298
299// medianFloat returns the median of a float slice.
300func medianFloat(vals []float64) float64 {

Callers 5

evalCreatePullRequestFunction · 0.85
TestTimeBetweenFunction · 0.85
evalCreateIssueFunction · 0.85
evalAssignToAgentFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestTimeBetweenFunction · 0.68