1 |
< |
#include <iostream.h> |
2 |
< |
#include <sys/loadavg.h> |
1 |
> |
#include "load.hh" |
2 |
|
|
3 |
< |
int main() { |
3 |
> |
void printLoad() { |
4 |
|
double loadavg[3]; |
6 |
– |
|
5 |
|
int res = getloadavg(loadavg, 3); |
6 |
|
|
7 |
< |
cout << "Load average over the last ..." << endl; |
8 |
< |
cout << "... 1 minute: " << loadavg[0] << endl; |
11 |
< |
cout << "... 5 minutes: " << loadavg[1] << endl; |
12 |
< |
cout << "... 15 minutes: " << loadavg[2] << endl; |
13 |
< |
|
14 |
< |
return 0; |
7 |
> |
cout << "load average: " << loadavg[0] << ", " |
8 |
> |
<< loadavg[1] << ", " << loadavg[2] << endl; |
9 |
|
} |