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