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() {
  long uptime = 0;
  std::string line;
  std::ifstream fileStream(kProcDirectory + kUptimeFilename);
  if(fileStream.is_open())
  {
    std::getline(fileStream, line);
    std::istringstream linestream(line);
    linestream >> uptime;
  }
  return uptime;
}
long LinuxParser :: UpTime ( ) { long uptime = 0 ; std :: string line ; std :: ifstream fileStream ( kProcDirectory + kUptimeFilename ) ; if ( fileStream . is_open ( ) ) { std :: getline ( fileStream , line ) ; std :: istringstream linestream ( line ) ; linestream >> uptime ; } return uptime ; }
TODO: Read and return the system uptime
TODO : Read and return the system uptime