Jpp  debug
the software that should make you happy
Functions
JSysinfo.cc File Reference

Example program to print system information. More...

#include <iostream>
#include <iomanip>
#include "JSystem/JSysinfo.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Example program to print system information.

Author
mdejong

Definition in file JSysinfo.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 14 of file JSysinfo.cc.

15 {
16  using namespace std;
17 
18  try {
19 
20  JParser<> zap("Example program to print system information.");
21 
22  zap(argc, argv);
23  }
24  catch(const exception &error) {
25  FATAL(error.what() << endl);
26  }
27 
28  using namespace JPP;
29 
30  const JSysinfo info;
31 
32  cout << "up-time " << info.uptime << endl;
33  cout << "RAM total " << info.totalram << endl;
34  cout << "RAM free " << info.freeram << endl;
35  cout << "memory " << info.mem_unit << endl;
36  cout << "RAM " << info.getTotalRAM() << endl;
37 }
#define FATAL(A)
Definition: JMessage.hh:67
Utility class to parse command line options.
Definition: JParser.hh:1714
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
Auxiliary class for system information.
Definition: JSysinfo.hh:38
unsigned long long int getTotalRAM() const
Get total RAM.
Definition: JSysinfo.hh:64