Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::Timer Class Reference

Instance of this class is used for measure time consumtion of block code until instance is alive and write result to debug output. More...

#include <src/libslic3r/Timer.hpp>

+ Collaboration diagram for Slic3r::Timer:

Public Member Functions

 Timer (const std::string &name)
 name describe timer
 
 ~Timer ()
 name describe timer
 

Private Attributes

std::string m_name
 
std::chrono::steady_clock::time_point m_start
 

Detailed Description

Instance of this class is used for measure time consumtion of block code until instance is alive and write result to debug output.

Constructor & Destructor Documentation

◆ Timer()

Slic3r::Timer::Timer ( const std::string &  name)

name describe timer

Parameters
nameDescribe timer in consol log
6: m_name(name), m_start(steady_clock::now()) {}
std::string m_name
Definition Timer.hpp:15
std::chrono::steady_clock::time_point m_start
Definition Timer.hpp:16

◆ ~Timer()

Slic3r::Timer::~Timer ( )

name describe timer

9{
10 BOOST_LOG_TRIVIAL(debug) << "Timer '" << m_name << "' spend " <<
11 duration_cast<milliseconds>(steady_clock::now() - m_start).count() << "ms";
12}

Member Data Documentation

◆ m_name

std::string Slic3r::Timer::m_name
private

◆ m_start

std::chrono::steady_clock::time_point Slic3r::Timer::m_start
private

The documentation for this class was generated from the following files: