---
name: "mlpack_Timer"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_Timer"
---

# mlpack\_Timer(3)

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

## NAME

mlpack::Timer -

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

## SYNOPSIS

### Static Public Member Functions

static timeval **Get** (const std::string &name)\
 *Get the value of the given timer.*  static void **Start** (const std::string &name)\
 *Start the given timer.*  static void **Stop** (const std::string &name)\
 *Stop the given timer.*

## 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 73 of file timers.hpp.

## Member Function Documentation

### static timeval mlpack::Timer::Get (const std::string &name)` [static]`

Get the value of the given timer.

**Parameters:**

*name* Name of timer to return value of.

### 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:**

*name* Name of timer to be started.

### 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:**

*name* Name of timer to be stopped.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
