Id like to measure the cpu usage during the execution of a command. If I type $ cp BigFile Location Id like to see how much this process used cpu power
3 Answers
top command will show you memory and CPU usage,
you can pipe with grep
top | grep chrome # for google chrome cpu and mem usage for and example
7 Comments
René
that works but how do i check the usage from a command within a script and store it into a file or smth
Hutch
cant you use PID ?
René
but how does the script know when to stop monitoring
Hutch
how about giving approximate time loop : stackoverflow.com/questions/11176284/…
René
would work but for a script... its not the most elegant way
|
time cp Location, will give you processing time, what metric are you after?