-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBenchmark.cpp
More file actions
38 lines (28 loc) · 1004 Bytes
/
Benchmark.cpp
File metadata and controls
38 lines (28 loc) · 1004 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
#include "Benchmark.hpp"
constexpr Benchmark::Benchmark::Benchmark() { }
constexpr Benchmark::Benchmark::~Benchmark() { }
Benchmark::Benchmark* Benchmark::Benchmark::Instance() {
if (instance == nullptr) {
std::unique_lock<std::mutex> lock(benchmarkLock);
if (instance == nullptr) {
instance = new Benchmark();
}
}
return instance;
}
void Benchmark::Benchmark::setLineImpl(auto& f) {
__line_impl = f;
}
void Benchmark::Benchmark::setWordImpl(auto& f) {
__word_impl = f;
}
void Benchmark::Benchmark::setCharImpl(auto& f) {
__word_impl = f;
}
void Benchmark::Benchmark::setBytesImpl(auto& f) {
__word_impl = f;
}
auto &Benchmark::Benchmark::getLineImpl() const { return __line_impl; }
auto &Benchmark::Benchmark::getWordImpl() const { return __word_impl; }
auto &Benchmark::Benchmark::getCharImpl() const { return __char_impl; }
auto &Benchmark::Benchmark::getBytesImpl() const { return __bytes_impl; }