Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JSysinfo.cc
Go to the documentation of this file.
1#include <iostream>
2#include <iomanip>
3
4#include "JSystem/JSysinfo.hh"
5#include "Jeep/JParser.hh"
6#include "Jeep/JMessage.hh"
7
8/**
9 * \file
10 *
11 * Example program to print system information.
12 * \author mdejong
13 */
14int main(int argc, char* argv[])
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}
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
Utility class to parse command line options.
int main(int argc, char *argv[])
Definition JSysinfo.cc:14
System information.
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for system information.
Definition JSysinfo.hh:38
unsigned long long int getTotalRAM() const
Get total RAM.
Definition JSysinfo.hh:64