mlpack: a scalable c++ machine learning library
mlpack  1.0.6
mlpack::Timer Class Reference

The timer class provides a way for mlpack methods to be timed. More...

Static Public Member Functions

static timeval Get (const std::string &name)
 Get the value of the given timer. More...

 
static void Start (const std::string &name)
 Start the given timer. More...

 
static void Stop (const std::string &name)
 Stop the given timer. More...

 

Detailed Description

The timer class provides a way for mlpack methods to be timed.

The three methods contained in this class allow a named timer to be started and stopped, and its value to be obtained.

Definition at line 48 of file timers.hpp.

Member Function Documentation

◆ Get()

static timeval mlpack::Timer::Get ( const std::string &  name)
static

Get the value of the given timer.

Parameters
nameName of timer to return value of.

◆ Start()

static void mlpack::Timer::Start ( const std::string &  name)
static

Start the given timer.

If a timer is started, then stopped, then re-started, then re-stopped, the final value of the timer is the length of both runs – that is, mlpack timers are additive for each time they are run, and do not reset.

Note
Undefined behavior will occur if a timer is started twice.
Parameters
nameName of timer to be started.

◆ Stop()

static void mlpack::Timer::Stop ( const std::string &  name)
static

Stop the given timer.

Note
Undefined behavior will occur if a timer is started twice.
Parameters
nameName of timer to be stopped.

The documentation for this class was generated from the following file:
  • /var/www/www.mlpack.org/mlpack-1.0.6/src/mlpack/core/util/timers.hpp