src/linux_parser.cpp
long LinuxParser::UpTime() {
  string UpTime;
  string IdleTime;
  string line;
  std::ifstream stream(kProcDirectory + kUptimeFilename);
  if (stream.is_open()) {
    std::getline(stream, line);
    std::istringstream linestream(line);  // get string stream of each line and
                                          // " " as delimiter to get each token
    linestream >> UpTime >> IdleTime;
    return stol(UpTime);
  }
  stream.close();
  return 0;
}
// REVIEW: Read and return the system uptime in seconds
Read and return the system uptime in seconds
Read and return the system uptime in seconds
long LinuxParser::UpTime() {
  string UpTime;
  string IdleTime;
  string line;
  std::ifstream stream(kProcDirectory + kUptimeFilename);
  if (stream.is_open()) {
    std::getline(stream, line);
    std::istringstream linestream(line);  
    linestream >> UpTime >> IdleTime;
    return stol(UpTime);
  }
  stream.close();
  return 0;
}
long LinuxParser :: UpTime ( ) { string UpTime ; string IdleTime ; string line ; std :: ifstream stream ( kProcDirectory + kUptimeFilename ) ; if ( stream . is_open ( ) ) { std :: getline ( stream , line ) ; std :: istringstream linestream ( line ) ; linestream >> UpTime >> IdleTime ; return stol ( UpTime ) ; } stream . close ( ) ; return 0 ; }
REVIEW: Read and return the system uptime in seconds
REVIEW : Read and return the system uptime in seconds
// get string stream of each line and // " " as delimiter to get each token