Created
May 22, 2019 14:11
-
-
Save simcap/3643463262fb7227ffa6c2490b72a64d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func logProcessUsage(cmd *exec.Cmd) { | |
switch v := cmd.ProcessState.SysUsage().(type) { | |
case *syscall.Rusage: | |
log.Printf("%s: mem=%.2fM, systime=%s, usertime=%s", cmd.Path, float64(v.Maxrss/1000), cmd.ProcessState.SystemTime(), cmd.ProcessState.UserTime()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment