MCPcopy Create free account
hub / github.com/cli/cli / Duration

Method Duration

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

Source from the content-addressed store, hash-verified

119}
120
121func (r *Run) Duration(now time.Time) time.Duration {
122 endTime := r.UpdatedAt
123 if r.Status != Completed {
124 endTime = now
125 }
126 d := endTime.Sub(r.StartedTime())
127 if d < 0 {
128 return 0
129 }
130 return d.Round(time.Second)
131}
132
133type Repo struct {
134 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