mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | List of all members
mf::stopwatch Class Reference

Stop watch which measures total time passed between start() and stop() calls. More...

#include <stopwatch.h>

Public Types

using clock_type = std::chrono::high_resolution_clock
 
using time_point_type = typename clock_type::time_point
 
using duration_type = typename clock_type::duration
 

Public Member Functions

void reset ()
 Reset accumulated duration and stop. More...
 
void start ()
 Start the stopwatch. More...
 
void stop ()
 Stop the stopwatch, and add duration since last start() call to total duration. More...
 
duration_type total_duration () const
 Get total duration. More...
 

Detailed Description

Stop watch which measures total time passed between start() and stop() calls.

Can accumulate multiple time intervals.

Member Typedef Documentation

using mf::stopwatch::clock_type = std::chrono::high_resolution_clock
using mf::stopwatch::duration_type = typename clock_type::duration
using mf::stopwatch::time_point_type = typename clock_type::time_point

Member Function Documentation

void mf::stopwatch::reset ( )
inline

Reset accumulated duration and stop.

void mf::stopwatch::start ( )
inline

Start the stopwatch.

void mf::stopwatch::stop ( )
inline

Stop the stopwatch, and add duration since last start() call to total duration.

duration_type mf::stopwatch::total_duration ( ) const
inline

Get total duration.

Cannot be called while stopwatch is running.


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