【重构】目录结构调整

This commit is contained in:
wdp
2025-01-18 19:46:27 +08:00
parent b48fe78d29
commit 970d3230e3
2 changed files with 0 additions and 0 deletions

20
src/util/TimeCount.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "TimeCount.h"
#include <iostream>
USE_TIME::USE_TIME(std::string str) :
strTmp(str)
{
start = std::chrono::system_clock::now();
}
USE_TIME::~USE_TIME()
{
end = std::chrono::system_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
std::cout << strTmp << "\t" << float(duration.count()*1.0) * std::chrono::milliseconds::period::num << "ms \t\n";
//auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
//std::cout << strTmp << "\t" << float(duration.count()*1.0) * std::chrono::microseconds::period::num << "ms \t\n";
}

18
src/util/TimeCount.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef TIME_COUNT_H
#define TIME_COUNT_H
#include <string>
#include <chrono>
class USE_TIME{
public:
USE_TIME(std::string str = "");
~USE_TIME();
private:
std::string strTmp;
std::chrono::system_clock::time_point start;
std::chrono::system_clock::time_point end;
};
#endif