summaryrefslogtreecommitdiff
path: root/main.c
blob: f921ab844d0ad620aef2fec3252d78e5c01cf17d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<stdio.h>
#include<string.h>
#include<sys/resource.h>
#include<sys/utsname.h>
#include<sys/sysinfo.h>
#include<sys/types.h>
#include<unistd.h>

#define CPUINFO "/proc/cpuinfo";
#define CPUFREQ "/sys/devices/system/cpu/cpu0/cpufreq/";
#define CLEAR "\033[2J";
#define REPOS "\033[H"; // Re-positions the cursor to top left of screen

void move(int row, int col) {
    printf("\x1b[%d;%df", row, col);
}

int main(int argc, char** argv) {
    short memory = 0;
    short cpu = 0;
    short cores = 0;
    int samples = 20;
    long tdelay = 500000;
    for (int i = 1; i < argc ; i++) { 
	if (strstr(*argv, "--memory"))
	    memory = 1;
	if (strstr(*argv, "--cpu"))
	    cpu = 1;
	if (strstr(*argv, "--cores"))
	    cores = 1;
	if (strstr(argv[i], "--samples="))
	    ;
	if (strstr(argv[i], "--tdelay="))
	    ;
    }
    return 0;
}