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