Ulf Gebhardt ac99a7097e Add 'login_server/' from commit 'ca71af1817a801db9a108c205bc298250d498c4b'
git-subtree-dir: login_server
git-subtree-mainline: 09ebb40de21084bb10ee466429d900a5e757d349
git-subtree-split: ca71af1817a801db9a108c205bc298250d498c4b
2021-03-17 22:05:25 +01:00

35 lines
651 B
C++

/*!
*
* \author: einhornimmond
*
* \date: 08.03.19
*
* \brief: easy to use time profiler
*/
#ifndef DR_LUA_WEB_MODULE_CORE_LIB_PROFILER_H
#define DR_LUA_WEB_MODULE_CORE_LIB_PROFILER_H
#include <chrono>
#include <string>
class Profiler
{
public:
Profiler();
Profiler(const Profiler& copy);
~Profiler();
inline void reset() { mStartTick = std::chrono::high_resolution_clock::now(); }
double millis() const;
double micros() const;
double nanos() const;
double seconds() const;
std::string string() const;
protected:
std::chrono::time_point<std::chrono::high_resolution_clock> mStartTick;
};
#endif //DR_LUA_WEB_MODULE_CORE_LIB_PROFILER_H