Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::port::Timer Class Reference

#include "timer.h"

Public Types

typedef std::conditional
< std::chrono::high_resolution_clock::is_steady,
std::chrono::high_resolution_clock,
std::chrono::steady_clock >
::type 
steady_clock
 Use the high_resolution_clock if it is steady, otherwise use the steady_clock. More...
 
typedef steady_clock Clock
 

Public Member Functions

 Timer ()
 
void Reset ()
 Resets the timer. More...
 
Clock::duration Get () const
 Returns the elapsed time since construction or the last Reset(). More...
 
double GetInS () const
 Returns the elapsed time since construction or the last Reset() in seconds. More...
 
double GetInMs () const
 Returns the elapsed time since construction or the last Reset() in milliseconds. More...
 

Static Public Member Functions

static void SleepNSeconds (unsigned int seconds)
 Sleeps for the passed number of seconds. More...
 
static void SleepNMilliseconds (unsigned int milliseconds)
 Sleeps for n milliseconds. More...
 

Detailed Description

Definition at line 29 of file timer.h.

Member Typedef Documentation

Definition at line 52 of file timer.h.

typedef std::conditional<std::chrono::high_resolution_clock::is_steady, std::chrono::high_resolution_clock, std::chrono::steady_clock>::type ion::port::Timer::steady_clock

Use the high_resolution_clock if it is steady, otherwise use the steady_clock.

Definition at line 49 of file timer.h.

Constructor & Destructor Documentation

ion::port::Timer::Timer ( )
inline

Definition at line 54 of file timer.h.

References Reset().

Member Function Documentation

Timer::Clock::duration ion::port::Timer::Get ( ) const
double ion::port::Timer::GetInMs ( ) const

Returns the elapsed time since construction or the last Reset() in milliseconds.

Convenience wrapper for Get().

Definition at line 92 of file timer.cc.

References Get().

double ion::port::Timer::GetInS ( ) const

Returns the elapsed time since construction or the last Reset() in seconds.

Convenience wrapper for Get().

Definition at line 87 of file timer.cc.

References Get().

Referenced by ion::analytics::GpuPerformanceTester::MeasurePerformance(), and ion::analytics::GpuPerformanceTester::MeasureResourceCreation().

void ion::port::Timer::Reset ( )
void ion::port::Timer::SleepNMilliseconds ( unsigned int  milliseconds)
static

Sleeps for n milliseconds.

static

Definition at line 74 of file timer.cc.

void ion::port::Timer::SleepNSeconds ( unsigned int  seconds)
static

Sleeps for the passed number of seconds.

static

Definition at line 71 of file timer.cc.


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