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