CLI11  2.1.2
Public Member Functions | List of all members
CLI::AutoTimer Class Reference

This class prints out the time upon destruction. More...

#include <Timer.hpp>

Inheritance diagram for CLI::AutoTimer:
CLI::Timer

Public Member Functions

 AutoTimer (std::string title="Timer", time_print_t time_print=Simple)
 Reimplementing the constructor is required in GCC 4.7. More...
 
 ~AutoTimer ()
 This destructor prints the string. More...
 
- Public Member Functions inherited from CLI::Timer
 Timer (std::string title="Timer", time_print_t time_print=Simple)
 Standard constructor, can set title and print function. More...
 
std::string time_it (std::function< void()> f, double target_time=1)
 Time a function by running it multiple times. Target time is the len to target. More...
 
std::string make_time_str () const
 This formats the numerical value for the time string. More...
 
std::string make_time_str (double time) const
 This prints out a time string from a time. More...
 
std::string to_string () const
 This is the main function, it creates a string. More...
 
Timeroperator/ (std::size_t val)
 Division sets the number of cycles to divide by (no graphical change) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CLI::Timer
static std::string Simple (std::string title, std::string time)
 Standard print function, this one is set by default. More...
 
static std::string Big (std::string title, std::string time)
 This is a fancy print function with — headers. More...
 
- Protected Types inherited from CLI::Timer
using clock = std::chrono::steady_clock
 This is a typedef to make clocks easier to use. More...
 
using time_point = std::chrono::time_point< clock >
 This typedef is for points in time. More...
 
using time_print_t = std::function< std::string(std::string, std::string)>
 This is the type of a printing function, you can make your own. More...
 
- Protected Attributes inherited from CLI::Timer
std::string title_
 This is the title of the timer. More...
 
time_print_t time_print_
 This is the function that is used to format most of the timing message. More...
 
time_point start_
 This is the starting point (when the timer was created) More...
 
std::size_t cycles {1}
 This is the number of times cycles (print divides by this number) More...
 

Detailed Description

This class prints out the time upon destruction.

Constructor & Destructor Documentation

◆ AutoTimer()

CLI::AutoTimer::AutoTimer ( std::string  title = "Timer",
time_print_t  time_print = Simple 
)
inlineexplicit

Reimplementing the constructor is required in GCC 4.7.

◆ ~AutoTimer()

CLI::AutoTimer::~AutoTimer ( )
inline

This destructor prints the string.


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