Add timer for measure time consumption

This commit is contained in:
Filip Sykala - NTB T15p 2022-10-21 09:53:16 +02:00
parent e85e7a743b
commit 47952e0c08
5 changed files with 129 additions and 71 deletions

31
src/libslic3r/Timer.hpp Normal file
View file

@ -0,0 +1,31 @@
#ifndef libslic3r_Timer_hpp_
#define libslic3r_Timer_hpp_
#include <string>
#include <chrono>
namespace Slic3r {
/// <summary>
/// Instance of this class is used for measure time consumtion
/// of block code until instance is alive and write result to debug output
/// </summary>
class Timer
{
std::string m_name;
std::chrono::steady_clock::time_point m_start;
public:
/// <summary>
/// name describe timer
/// </summary>
/// <param name="name">Describe timer in consol log</param>
Timer(const std::string& name);
/// <summary>
/// name describe timer
/// </summary>
~Timer();
};
} // namespace Slic3r
#endif // libslic3r_Timer_hpp_