-
Notifications
You must be signed in to change notification settings - Fork 14
/
Test.cpp
29 lines (22 loc) · 808 Bytes
/
Test.cpp
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
#include <chrono>
#include <thread>
#include "Stopwatch.h"
int main(int, char**) {
// This stops duplicate timings on multiple runs
Stopwatch::getInstance().setCustomSignature(32434);
while (true) {
STOPWATCH("Timing1", std::this_thread::sleep_for(std::chrono::milliseconds(10)););
TICK("Timing2");
std::this_thread::sleep_for(std::chrono::milliseconds(50));
TOCK("Timing2");
for (size_t i = 3; i < 10; i++) {
Stopwatch::getInstance().tick(
"Timing" + std::to_string(i), Stopwatch::getCurrentSystemTime());
std::this_thread::sleep_for(std::chrono::milliseconds(i));
Stopwatch::getInstance().tock(
"Timing" + std::to_string(i), Stopwatch::getCurrentSystemTime());
}
TOCK("Timing10");
Stopwatch::getInstance().sendAll();
}
}