src/linux_parser.cpp
// TODO: Read and return the system uptime
Read and return the system uptime
Read and return the system uptime
long LinuxParser::UpTime() {
  std::ifstream istream(kProcDirectory + kUptimeFilename);
  string line;
  long upTime = 0;
  if (istream.is_open()) {
    std::getline(istream, line);
    std::istringstream linestream(line);
    linestream >> upTime;
    return upTime;
  }
  return 0;
}
long LinuxParser :: UpTime ( ) { std :: ifstream istream ( kProcDirectory + kUptimeFilename ) ; string line ; long upTime = 0 ; if ( istream . is_open ( ) ) { std :: getline ( istream , line ) ; std :: istringstream linestream ( line ) ; linestream >> upTime ; return upTime ; } return 0 ; }
TODO: Read and return the system uptime
TODO : Read and return the system uptime