FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::StopWatch Class Reference

Stop-Watch class. More...

#include <stop_watch.hpp>

Public Member Functions

double elapsed () const
 Returns the total elapsed time in seconds. More...
 
long long elapsed_micros () const
 Returns the total elapsed time in micro-seconds. More...
 
String elapsed_string (TimeFormat format=TimeFormat::s_m) const
 Return the time elapsed in the stop-watch. More...
 
String percent_of (const StopWatch &total_watch, const String &prefix=" [", const String &postfix="% ]") const
 Returns the formatted percentage that this stop watch elapsed time relative to another total runtime stop watch. More...
 
void reset ()
 Resets the elapsed time. More...
 
bool running () const
 Returns true if the stop-watch is currently running. More...
 
void start ()
 Starts the stop-watch. More...
 
void stop ()
 Stops the stop-watch and increments elapsed time. More...
 

Private Attributes

long long _micros
 
bool _running
 
TimeStamp _start_time
 
TimeStamp _stop_time
 

Detailed Description

Stop-Watch class.

This class implements an incremental stop-watch.

Author
Peter Zajac

Definition at line 20 of file stop_watch.hpp.

Constructor & Destructor Documentation

◆ StopWatch()

FEAT::StopWatch::StopWatch ( )
inline

Definition at line 29 of file stop_watch.hpp.

Member Function Documentation

◆ elapsed()

◆ elapsed_micros()

long long FEAT::StopWatch::elapsed_micros ( ) const
inline

Returns the total elapsed time in micro-seconds.

Definition at line 76 of file stop_watch.hpp.

References FEAT::TimeStamp::elapsed_micros().

Referenced by elapsed(), and elapsed_string().

◆ elapsed_string()

String FEAT::StopWatch::elapsed_string ( TimeFormat  format = TimeFormat::s_m) const
inline

Return the time elapsed in the stop-watch.

See TimeStamp::format_micros() for more information about the formatting options.

Parameters
[in]formatSpecifies the output string format to be used.
Returns
The time elapsed between in the stop-watch as a formatted string h:mm:ss.nnn.

Definition at line 98 of file stop_watch.hpp.

References elapsed_micros(), and FEAT::TimeStamp::format_micros().

◆ percent_of()

String FEAT::StopWatch::percent_of ( const StopWatch total_watch,
const String prefix = " [",
const String postfix = "% ]" 
) const
inline

Returns the formatted percentage that this stop watch elapsed time relative to another total runtime stop watch.

Parameters
[in]total_watchThe stop watch that represents the total runtime
[in]prefixThe prefix string
[in]postfixThe postfix string
Returns
The formatted percentage of this stop watch elapsed time relative to watch_total

Definition at line 117 of file stop_watch.hpp.

References elapsed(), and FEAT::stringify_fp_fix().

◆ reset()

◆ running()

bool FEAT::StopWatch::running ( ) const
inline

Returns true if the stop-watch is currently running.

Definition at line 64 of file stop_watch.hpp.

◆ start()

void FEAT::StopWatch::start ( )
inline

Starts the stop-watch.

Definition at line 43 of file stop_watch.hpp.

References FEAT::TimeStamp::stamp().

Referenced by FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_apply(), FEAT::Solver::AmaVanka< Matrix_, Filter_ >::apply(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::apply(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_base_mesh_2d(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_base_mesh_3d(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_hierarchy(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map_from_chart(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map_from_lambda(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map_from_off(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_numeric(), FEAT::Solver::AmaVanka< Matrix_, Filter_ >::init_numeric(), FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >::init_numeric(), FEAT::Solver::VoxelAmaVanka< Matrix_, Filter_, pol_threading_, macro_type_ >::init_numeric(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_symbolic(), FEAT::Solver::AmaVanka< Matrix_, Filter_ >::init_symbolic(), FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >::init_symbolic(), FEAT::Solver::VoxelAmaVanka< Matrix_, Filter_, pol_threading_, macro_type_ >::init_symbolic(), and FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::read_voxel_map().

◆ stop()

void FEAT::StopWatch::stop ( )
inline

Stops the stop-watch and increments elapsed time.

Definition at line 51 of file stop_watch.hpp.

References FEAT::TimeStamp::elapsed_micros(), and FEAT::TimeStamp::stamp().

Referenced by FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::_apply(), FEAT::Solver::AmaVanka< Matrix_, Filter_ >::apply(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::apply(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_base_mesh_2d(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_base_mesh_3d(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_hierarchy(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map_from_chart(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map_from_lambda(), FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::create_voxel_map_from_off(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_numeric(), FEAT::Solver::AmaVanka< Matrix_, Filter_ >::init_numeric(), FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >::init_numeric(), FEAT::Solver::VoxelAmaVanka< Matrix_, Filter_, pol_threading_, macro_type_ >::init_numeric(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::init_symbolic(), FEAT::Solver::AmaVanka< Matrix_, Filter_ >::init_symbolic(), FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >::init_symbolic(), FEAT::Solver::VoxelAmaVanka< Matrix_, Filter_, pol_threading_, macro_type_ >::init_symbolic(), and FEAT::Control::Domain::VoxelDomainControl< DomainLevel_ >::read_voxel_map().

Member Data Documentation

◆ _micros

long long FEAT::StopWatch::_micros
private

Definition at line 26 of file stop_watch.hpp.

◆ _running

bool FEAT::StopWatch::_running
private

Definition at line 25 of file stop_watch.hpp.

◆ _start_time

TimeStamp FEAT::StopWatch::_start_time
private

Definition at line 23 of file stop_watch.hpp.

◆ _stop_time

TimeStamp FEAT::StopWatch::_stop_time
private

Definition at line 24 of file stop_watch.hpp.


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