Newer
Older
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
#include "Event.h"
#include "Jikan-config.h"
using namespace std;
EventData::EventData(){}
EventData::~EventData()
{
this->time_series.clear();
}
EventData::EventData(const string& name)
{
this->start = chrono::steady_clock::now();
this->elapsed_time = 0.0;
this->count = 0;
this->ifCUDA = 0;
this->event_name = name;
this->ifStart = false, this->ifEnd = false;
}
EventData& EventData::operator=(const EventData& src)
{
this->start = src.start;
this->elapsed_time = 0.0;
this->count = 0;
this->ifCUDA = 0;
this->event_name = src.event_name;
this->ifStart = false, this->ifEnd = false;
return *this;
}
double EventData::GetMeanElapsedTime()
{
return this->elapsed_time / this->count;
}