MCPcopy Index your code
hub / github.com/cli/cli / Duration

Method Duration

pkg/cmd/run/shared/shared.go:119–129  ·  view source on GitHub ↗
(now time.Time)

Source from the content-addressed store, hash-verified

117}
118
119func (r *Run) Duration(now time.Time) time.Duration {
120 endTime := r.UpdatedAt
121 if r.Status != Completed {
122 endTime = now
123 }
124 d := endTime.Sub(r.StartedTime())
125 if d < 0 {
126 return 0
127 }
128 return d.Round(time.Second)
129}
130
131type Repo struct {
132 Owner struct {

Callers 11

TestRun_DurationFunction · 0.95
Test_viewRunFunction · 0.80
Test_listRunFunction · 0.80
Test_listRunFunction · 0.80
TestListRunFunction · 0.80
TestListRunFunction · 0.80
listRunFunction · 0.80
TestNewCmdChecksFunction · 0.80
TestDeleteFunction · 0.80
viewWorkflowInfoFunction · 0.80
sharedCmdsFunction · 0.80

Calls 1

StartedTimeMethod · 0.95

Tested by 9

TestRun_DurationFunction · 0.76
Test_viewRunFunction · 0.64
Test_listRunFunction · 0.64
Test_listRunFunction · 0.64
TestListRunFunction · 0.64
TestListRunFunction · 0.64
TestNewCmdChecksFunction · 0.64
TestDeleteFunction · 0.64
sharedCmdsFunction · 0.64