src/process.cpp
// TODO: Return this process's CPU utilization
Return this process's CPU utilization
Return this process ' s CPU utilization
float Process::CpuUtilization() { 
  _total_time = LinuxParser::ActiveJiffies(_pid)/sysconf(_SC_CLK_TCK); 
  _seconds = LinuxParser::UpTime(_pid);
  if(_seconds>0){
      return _total_time/_seconds;
  }
  else
  {
     return 0;
  }
}
float Process :: CpuUtilization ( ) { _total_time = LinuxParser :: ActiveJiffies ( _pid ) / sysconf ( _SC_CLK_TCK ) ; _seconds = LinuxParser :: UpTime ( _pid ) ; if ( _seconds > 0 ) { return _total_time / _seconds ; } else { return 0 ; } }
TODO: Return this process's CPU utilization
TODO : Return this process ' s CPU utilization