mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
git-subtree-dir: login_server git-subtree-mainline: 09ebb40de21084bb10ee466429d900a5e757d349 git-subtree-split: ca71af1817a801db9a108c205bc298250d498c4b
35 lines
651 B
C++
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
|