Sokoban
Public Member Functions | Private Attributes | List of all members
MyTimer Class Reference

Time measurement class. More...

#include <Timer.h>

Public Member Functions

 MyTimer ()
 Constructor. More...
 
void start_clock ()
 Starts time measurement. More...
 
uint64_t stop_clock ()
 Stops clock and get number of seconds since start. More...
 
const std::string & get_time ()
 Gets time in format hh:mm:ss of seconds since start or between start and stop. More...
 

Private Attributes

uint64_t old_value
 
std::string old_time_str
 
std::chrono::time_point< std::chrono::system_clock > start
 
bool stopped
 

Detailed Description

Time measurement class.

Constructor & Destructor Documentation

◆ MyTimer()

MyTimer::MyTimer ( )
inline

Constructor.

Sets defalt values.

Member Function Documentation

◆ get_time()

const std::string& MyTimer::get_time ( )
inline

Gets time in format hh:mm:ss of seconds since start or between start and stop.

Returns
Time in string in format hh:mm:ss since start or between start and stop.

◆ start_clock()

void MyTimer::start_clock ( )
inline

Starts time measurement.

◆ stop_clock()

uint64_t MyTimer::stop_clock ( )
inline

Stops clock and get number of seconds since start.

Returns
Number of seconds since start.

Member Data Documentation

◆ old_time_str

std::string MyTimer::old_time_str
private

Last asked string value corresponding to old_value

◆ old_value

uint64_t MyTimer::old_value
private

Last asked second value

◆ start

std::chrono::time_point<std::chrono::system_clock> MyTimer::start
private

Clock

◆ stopped

bool MyTimer::stopped
private

bool value representing if timer is stopped


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