BitMagic-C++
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
bm::chrono_taker< TOut > Class Template Reference

Utility class to collect performance measurements and statistics. More...

#include <bmtimer.h>

Data Structures

struct  statistics
 collected statistics More...
 

Public Types

enum  format { ct_time = 0 , ct_ops_per_sec , ct_all }
 
typedef std::map< std::string, statisticsduration_map_type
 test name to duration map More...
 

Public Member Functions

 chrono_taker (TOut &tout, const std::string name, unsigned repeats=1, duration_map_type *dmap=0)
  More...
 
 ~chrono_taker ()
  More...
 
void stop (bool silent=false)
  More...
 
void add_repeats (unsigned inc)
  More...
 
 chrono_taker (const chrono_taker &)=delete
 
chrono_takeroperator= (const chrono_taker)=delete
 

Static Public Member Functions

template<typename DT >
static void print_duration (TOut &tout, const std::string &name, DT ms)
  More...
 
static void print_duration_map (TOut &tout, const duration_map_type &dmap, format fmt=ct_time)
  More...
 

Protected Attributes

TOut & tout_
  More...
 
std::string name_
  More...
 
std::chrono::time_point< std::chrono::steady_clock > start_
  More...
 
std::chrono::time_point< std::chrono::steady_clock > finish_
  More...
 
unsigned repeats_
  More...
 
duration_map_typedmap_
  More...
 
bool is_stopped_
  More...
 

Detailed Description

template<typename TOut = std::ostream>
class bm::chrono_taker< TOut >

Utility class to collect performance measurements and statistics.

Examples
inv_list.cpp, sample11.cpp, sample12.cpp, strsvsample02a.cpp, strsvsample07.cpp, svsample06.cpp, xsample01.cpp, xsample02.cpp, xsample03.cpp, xsample04.cpp, xsample04a.cpp, xsample05.cpp, xsample06.cpp, xsample07.cpp, xsample07a.cpp, and xsample09.cpp.

Definition at line 40 of file bmtimer.h.

Member Typedef Documentation

◆ duration_map_type

template<typename TOut = std::ostream>
typedef std::map<std::string, statistics > bm::chrono_taker< TOut >::duration_map_type

test name to duration map

Definition at line 66 of file bmtimer.h.

Member Enumeration Documentation

◆ format

template<typename TOut = std::ostream>
enum bm::chrono_taker::format
Enumerator
ct_time 
ct_ops_per_sec 
ct_all 

Definition at line 57 of file bmtimer.h.


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