2021-06-12 09:12:16 -04:00
|
|
|
// Created on: 3/28/21
|
|
|
|
|
|
|
|
|
|
#ifndef TimeUtility_hpp
|
|
|
|
|
#define TimeUtility_hpp
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <chrono>
|
|
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
namespace timeutil
|
|
|
|
|
{
|
|
|
|
|
std::string timeNow();
|
2021-06-12 09:12:16 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
struct Interval_st
|
|
|
|
|
{
|
2021-06-12 09:12:16 -04:00
|
|
|
private:
|
2022-10-24 18:39:33 +08:00
|
|
|
std::chrono::time_point<std::chrono::steady_clock> startTime;
|
2021-06-12 09:12:16 -04:00
|
|
|
|
|
|
|
|
public:
|
2022-10-24 18:39:33 +08:00
|
|
|
Interval_st();
|
|
|
|
|
void Start();
|
|
|
|
|
long long Elapsed();
|
|
|
|
|
long long Stop();
|
2021-06-12 09:12:16 -04:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* TimeUtility_hpp */
|