forked from xcore/tool_axe
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStats.h
More file actions
38 lines (34 loc) · 917 Bytes
/
Stats.h
File metadata and controls
38 lines (34 loc) · 917 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
// Copyright (c) 2011 Richard Osbourne, 2012 Steve Kerrison, All rights reserved
// This software is freely distributable under a derivative of the
// University of Illinois/NCSA Open Source License posted in
// LICENSE.txt and at <http://github.xcore.com/>
#ifndef _Stats_h_
#define _Stats_h_
#include "TerminalColours.h"
#include "Thread.h"
#include <iostream>
#include <sstream>
#include <string>
#include <memory>
#include <map>
class Stats {
private:
Stats() :
statsEnabled(false) {}
public:
bool statsEnabled;
static Stats instance;
int cores;
std::map<std::string, long long*> istats;
public:
void setStatsEnabled(bool enable) { statsEnabled = enable; }
bool getStatsEnabled() const { return statsEnabled; }
void initStats(const int cores);
void updateStats(const Thread &t, const char *name);
void dump();
static Stats &get()
{
return instance;
}
};
#endif //_Stats_h_