OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
StopWatch.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include "utils_export.h"
5#include <string>
6
7namespace Utils
8{
10 {
11public:
12 StopWatch(bool start);
13
14 void start();
15 void stop();
16
17 std::chrono::system_clock::duration getElapsedDuration() const;
18
19 long long getElapsedMilliseconds() const;
20 double getElapsedSeconds() const;
21
22 std::string getElapsedSecondsString(const std::string& suffix = "") const;
23
24 //template<class D>
25 //std::chrono::system_clock::duration getElapsedDuration() const;
26
27 constexpr inline static const double MS_PER_SECOND = 1000.0;
28
29 private:
30 std::chrono::system_clock::time_point m_started;
31 std::chrono::system_clock::time_point m_finished;
32
33 bool m_stopped;
34
35 };
36}
#define UTILS_EXPORT