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