-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.h
More file actions
42 lines (32 loc) · 730 Bytes
/
Copy pathprocess.h
File metadata and controls
42 lines (32 loc) · 730 Bytes
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
38
39
40
41
42
#ifndef TASKMENAGER_PROCESS_H
#define TASKMENAGER_PROCESS_H
#include <utility>
#include <random>
#include <iostream>
#include <string>
#include <atomic>
#include <thread>
#include <mutex>
class Process {
public:
Process(int id, std::string name, int type);
~Process();
void start();
void stop();
void run();
void join();
double getCpuUsage() const;
double getRamUsage() const;
int getId() const;
std::string getName() const;
private:
int id;
int type;
std::string name;
std::atomic<bool> running;
std::thread worker;
double cpuUsage;
double ramUsage;
std::chrono::time_point<std::chrono::steady_clock> startTime;
};
#endif //TASKMENAGER_PROCESS_H