MCPcopy Create free account
hub / github.com/CPChain/chain / CpuProfile

Method CpuProfile

internal/debug/api.go:70–77  ·  view source on GitHub ↗

CpuProfile turns on CPU profiling for nsec seconds and writes profile data to file.

(file string, nsec uint)

Source from the content-addressed store, hash-verified

68// CpuProfile turns on CPU profiling for nsec seconds and writes
69// profile data to file.
70func (h *HandlerT) CpuProfile(file string, nsec uint) error {
71 if err := h.StartCPUProfile(file); err != nil {
72 return err
73 }
74 time.Sleep(time.Duration(nsec) * time.Second)
75 h.StopCPUProfile()
76 return nil
77}
78
79// StartCPUProfile turns on CPU profiling, writing to the given file.
80func (h *HandlerT) StartCPUProfile(file string) error {

Callers

nothing calls this directly

Calls 3

StartCPUProfileMethod · 0.95
StopCPUProfileMethod · 0.95
SleepMethod · 0.80

Tested by

no test coverage detected