apéro de samedi midi en route...
This commit is contained in:
38
essai.c
Normal file
38
essai.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* essai.c
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "funcs.h"
|
||||
|
||||
int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int opt, foo;
|
||||
int type = 0;
|
||||
double loads[3];
|
||||
|
||||
while ((opt = getopt(argc, argv, "vst:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'v': verbosity++; break;
|
||||
case 's': srand(getpid()); break;
|
||||
case 't': type = atoi(optarg); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
foo = get_loadavg(loads);
|
||||
if (foo) fprintf(stderr, "get loadavg -> %d\n", foo);
|
||||
|
||||
printf("%f %f %f %f\n", dtime(), loads[0], loads[1], loads[2]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
Reference in New Issue
Block a user