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::string Uptime, Idletime, line;
  long UT;
  std::ifstream stream(kProcDirectory + kUptimeFilename);
   if (stream.is_open()){
    while (std::getline(stream, line)){
      std::istringstream linestream(line);
      while (linestream>>Uptime>>Idletime){
        UT = std::stol(Uptime);
      }
    }
  }
  return UT; }
long LinuxParser :: UpTime ( ) { std :: string Uptime , Idletime , line ; long UT ; std :: ifstream stream ( kProcDirectory + kUptimeFilename ) ; if ( stream . is_open ( ) ) { while ( std :: getline ( stream , line ) ) { std :: istringstream linestream ( line ) ; while ( linestream >> Uptime >> Idletime ) { UT = std :: stol ( Uptime ) ; } } } return UT ; }
TODO: Read and return the system uptime
TODO : Read and return the system uptime
// std::cout<< UT << "  \n";