-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (28 loc) · 827 Bytes
/
Copy pathmain.cpp
File metadata and controls
48 lines (28 loc) · 827 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
43
44
45
46
47
48
#include <sstream>
#include <iostream>
#include <thread>
#include "internal/LogSlot.h"
#include "Logger.h"
#include <cstdio>
#include <fstream>
using namespace m_log;
using namespace m_log::internal;
int main() {
Logger logger("");
auto start = std::chrono::system_clock::now();
std::thread th([&logger]{
for(int i = 0;i < 1000;i++){
auto s= std::to_string(i);
logger.debug(s.c_str(),s.size(),Logger::WR_DISK);
}
});
for(int i = 0;i < 100000;i++){
auto s= std::to_string(i);
logger.debug(s.c_str(),s.size(),Logger::WR_DISK);
}
th.join();
auto end = std::chrono::system_clock::now();
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << std::endl;
return 0;
return 0;
}