X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/runtime/pprof
opt
/
golang
/
1.19.4
/
src
/
runtime
/
pprof
/
📁
..
📄
elf.go
(2.79 KB)
📄
label.go
(2.95 KB)
📄
label_test.go
(3.21 KB)
📄
map.go
(1.94 KB)
📄
mprof_test.go
(5.32 KB)
📄
pprof.go
(27.95 KB)
📄
pprof_norusage.go
(378 B)
📄
pprof_rusage.go
(838 B)
📄
pprof_test.go
(59.88 KB)
📄
proto.go
(25.59 KB)
📄
proto_test.go
(16.37 KB)
📄
protobuf.go
(2.51 KB)
📄
protomem.go
(2.91 KB)
📄
protomem_test.go
(2.53 KB)
📄
runtime.go
(1.5 KB)
📄
runtime_test.go
(3 KB)
📄
rusage_test.go
(827 B)
📁
testdata
📄
uname_linux_test.go
(1.3 KB)
📄
uname_other_test.go
(335 B)
Editing: rusage_test.go
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris package pprof import ( "syscall" "time" ) func init() { diffCPUTimeImpl = diffCPUTimeRUsage } func diffCPUTimeRUsage(f func()) (user, system time.Duration) { ok := true var before, after syscall.Rusage err := syscall.Getrusage(syscall.RUSAGE_SELF, &before) if err != nil { ok = false } f() err = syscall.Getrusage(syscall.RUSAGE_SELF, &after) if err != nil { ok = false } if !ok { return 0, 0 } user = time.Duration(after.Utime.Nano() - before.Utime.Nano()) system = time.Duration(after.Stime.Nano() - before.Stime.Nano()) return user, system }
Upload File
Create Folder