Apache Singa
A General Distributed Deep Learning Library
Public Types | Public Member Functions | List of all members
singa::Timer Class Reference

For benchmarking the time cost of operations. More...

#include <timer.h>

Public Types

typedef std::chrono::duration< int > Seconds
 
typedef std::chrono::duration< int, std::milli > Milliseconds
 
typedef std::chrono::duration< int, std::ratio< 60 *60 > > Hours
 
typedef std::chrono::duration< int, std::micro > Microseconds
 

Public Member Functions

 Timer ()
 Init the internal time point to the current time.
 
void Tick ()
 Reset the internal time point to the current time.
 
template<typename T = Milliseconds>
int Elapsed () const
 Return the duration since last call to Tick() or since the creation of Timer. More...
 

Detailed Description

For benchmarking the time cost of operations.

Member Function Documentation

◆ Elapsed()

template<typename T = Milliseconds>
int singa::Timer::Elapsed ( ) const
inline

Return the duration since last call to Tick() or since the creation of Timer.

The template arg must be from Second or Millisecond or Hour. The returned value is the count of the time metric.


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