deal2lkit: A ToolKit library for Deal.II
TimeUtilities Class Reference

This function collects some time utilities. More...

#include <utilities.h>

Public Member Functions

 TimeUtilities ()
 
void sleep (unsigned int t)
 It freezes the thread for t milliseconds. More...
 
void get_start_time ()
 It sets the start time for a measure. More...
 
void get_end_time ()
 It sets the end time for a measure. More...
 
int get_num_measures ()
 It returns the number of measures done. More...
 
double & operator[] (const unsigned int num)
 An overload of the operator [] is provided to access to all measures. More...
 

Private Attributes

bool status
 
std::chrono::high_resolution_clock::time_point t_start
 
std::chrono::high_resolution_clock::time_point t_end
 
std::vector< double > times
 

Detailed Description

This function collects some time utilities.

All measures are stored in seconds. Usage: get_start_time() should be used before get_end_time() and viceversa.

Definition at line 75 of file utilities.h.

Constructor & Destructor Documentation

§ TimeUtilities()

TimeUtilities::TimeUtilities ( )
inline

Definition at line 79 of file utilities.h.

Member Function Documentation

§ get_end_time()

void TimeUtilities::get_end_time ( )

It sets the end time for a measure.

Definition at line 50 of file utilities.cc.

§ get_num_measures()

int TimeUtilities::get_num_measures ( )

It returns the number of measures done.

Definition at line 62 of file utilities.cc.

§ get_start_time()

void TimeUtilities::get_start_time ( )

It sets the start time for a measure.

Definition at line 40 of file utilities.cc.

§ operator[]()

double& TimeUtilities::operator[] ( const unsigned int  num)
inline

An overload of the operator [] is provided to access to all measures.

Definition at line 108 of file utilities.h.

§ sleep()

void TimeUtilities::sleep ( unsigned int  t)

It freezes the thread for t milliseconds.

Definition at line 35 of file utilities.cc.

Member Data Documentation

§ status

bool TimeUtilities::status
private

Definition at line 114 of file utilities.h.

§ t_end

std::chrono::high_resolution_clock::time_point TimeUtilities::t_end
private

Definition at line 120 of file utilities.h.

§ t_start

std::chrono::high_resolution_clock::time_point TimeUtilities::t_start
private

Definition at line 119 of file utilities.h.

§ times

std::vector<double> TimeUtilities::times
private

Definition at line 121 of file utilities.h.


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