src/linux_parser.cpp
// TODO: Read and return the number of jiffies for the system
Read and return the number of jiffies for the system
Read and return the number of jiffies for the system
long LinuxParser::Jiffies() {
  string line, cpu;
  long usrjf, nicejf, systemjf;
  std::ifstream istream(kProcDirectory + kStatFilename);
  if (istream.is_open()) {
    std::getline(istream, line);
    std::istringstream linestream(line);
    linestream >> cpu >> usrjf >> nicejf >> systemjf;
    return systemjf;
  }
  return 0;
}
long LinuxParser :: Jiffies ( ) { string line , cpu ; long usrjf , nicejf , systemjf ; std :: ifstream istream ( kProcDirectory + kStatFilename ) ; if ( istream . is_open ( ) ) { std :: getline ( istream , line ) ; std :: istringstream linestream ( line ) ; linestream >> cpu >> usrjf >> nicejf >> systemjf ; return systemjf ; } return 0 ; }
TODO: Read and return the number of jiffies for the system
TODO : Read and return the number of jiffies for the system