WaitTime returns the time since the thread is waiting in a stable state in ms
()
| 209 | |
| 210 | // WaitTime returns the time since the thread is waiting in a stable state in ms |
| 211 | func (ts *ThreadState) WaitTime() int64 { |
| 212 | since := ts.waitingSince.Load() |
| 213 | if since == 0 { |
| 214 | return 0 |
| 215 | } |
| 216 | return time.Now().UnixMilli() - since |
| 217 | } |
| 218 | |
| 219 | func (ts *ThreadState) SetWaitTime(t time.Time) { |
| 220 | ts.waitingSince.Store(t.UnixMilli()) |
no outgoing calls
no test coverage detected