diff options
Diffstat (limited to 'src/runtime/debug.go')
| -rw-r--r-- | src/runtime/debug.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/runtime/debug.go b/src/runtime/debug.go index 0e61692f3d..3233ce8ee7 100644 --- a/src/runtime/debug.go +++ b/src/runtime/debug.go @@ -52,6 +52,17 @@ func NumCgoCall() int64 { return n } +func totalMutexWaitTimeNanos() int64 { + total := sched.totalMutexWaitTime.Load() + + total += sched.totalRuntimeLockWaitTime.Load() + for mp := (*m)(atomic.Loadp(unsafe.Pointer(&allm))); mp != nil; mp = mp.alllink { + total += mp.mLockProfile.waitTime.Load() + } + + return total +} + // NumGoroutine returns the number of goroutines that currently exist. func NumGoroutine() int { return int(gcount()) |
