CpuProfile turns on CPU profiling for nsec seconds and writes profile data to file.
(file string, nsec uint)
| 68 | // CpuProfile turns on CPU profiling for nsec seconds and writes |
| 69 | // profile data to file. |
| 70 | func (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. |
| 80 | func (h *HandlerT) StartCPUProfile(file string) error { |
nothing calls this directly
no test coverage detected