MosesTuning::Timer Class Reference

#include <Timer.h>

Collaboration diagram for MosesTuning::Timer:

Collaboration graph
[legend]

List of all members.

Classes

struct  CPUTime

Public Member Functions

 Timer ()
 ~Timer ()
void start (const char *msg=0)
void restart (const char *msg=0)
void check (const char *msg=0)
bool is_running () const
double get_elapsed_cpu_time () const
uint64_t get_elapsed_cpu_time_microseconds () const
double get_elapsed_wall_time () const
uint64_t get_elapsed_wall_time_microseconds () const
std::string ToString () const


Detailed Description

Definition at line 12 of file Timer.h.


Constructor & Destructor Documentation

MosesTuning::Timer::Timer (  )  [inline]

'm_is_running' is initially false. A timer needs to be explicitly started using 'start'.

Definition at line 38 of file Timer.h.

MosesTuning::Timer::~Timer (  )  [inline]

Definition at line 43 of file Timer.h.


Member Function Documentation

void Timer::check ( const char *  msg = 0  ) 

Print out an optional message followed by the current timer timing.

Definition at line 94 of file Timer.cpp.

References get_elapsed_cpu_time(), get_elapsed_wall_time(), and TRACE_ERR.

Referenced by MosesTuning::PrintUserTime().

Here is the call graph for this function:

Here is the caller graph for this function:

double Timer::get_elapsed_cpu_time (  )  const

Return the total time in seconds that the timer has been in the "running" state since it was first "started" or last "restarted". For "short" time periods (less than an hour), the actual cpu time used is reported instead of the elapsed time.

Definition at line 52 of file Timer.cpp.

References get_elapsed_cpu_time_microseconds().

Referenced by check(), and MosesTuning::GetUserTime().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t Timer::get_elapsed_cpu_time_microseconds (  )  const

Return the total time in microseconds.

Definition at line 57 of file Timer.cpp.

References util::CPUTime().

Referenced by get_elapsed_cpu_time().

Here is the call graph for this function:

Here is the caller graph for this function:

double Timer::get_elapsed_wall_time (  )  const

Get elapsed wall-clock time in seconds.

Definition at line 65 of file Timer.cpp.

References get_elapsed_wall_time_microseconds().

Referenced by BOOST_AUTO_TEST_CASE(), check(), and ToString().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t Timer::get_elapsed_wall_time_microseconds (  )  const

Get elapsed wall-clock time in microseconds.

Definition at line 70 of file Timer.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and get_elapsed_wall_time().

Here is the caller graph for this function:

bool MosesTuning::Timer::is_running (  )  const [inline]

Definition at line 64 of file Timer.h.

Referenced by BOOST_AUTO_TEST_CASE(), and MosesTuning::operator<<().

Here is the caller graph for this function:

void Timer::restart ( const char *  msg = 0  ) 

Restart the timer iff the timer is already running. if the timer is not running, just start the timer.

Definition at line 85 of file Timer.cpp.

References TRACE_ERR.

Referenced by BOOST_AUTO_TEST_CASE().

Here is the caller graph for this function:

void Timer::start ( const char *  msg = 0  ) 

Start a timer. If it is already running, let it continue running. Print an optional message.

Definition at line 75 of file Timer.cpp.

References TRACE_ERR.

Referenced by BOOST_AUTO_TEST_CASE(), and MosesTuning::ResetUserTime().

Here is the caller graph for this function:

std::string Timer::ToString (  )  const

Return a string that has the user CPU time, system time, and total time.

Definition at line 107 of file Timer.cpp.

References util::CPUTime(), and get_elapsed_wall_time().

Referenced by BOOST_AUTO_TEST_CASE(), and MosesTuning::operator<<().

Here is the call graph for this function:

Here is the caller graph for this function:


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

Generated on Thu Jul 6 00:34:21 2017 for Moses by  doxygen 1.5.9