Base Framework
Public Member Functions | List of all members
Timer::ElapsedTime Class Reference

Elapsed time conversion. More...

#include <base/Timer.h>

Public Member Functions

 ElapsedTime () noexcept
 
 ElapsedTime (uint64 _nanoseconds) noexcept
 
void roundToMicrosecond () noexcept
 
void roundToMillisecond () noexcept
 
void roundToSecond () noexcept
 
void roundToMinute () noexcept
 
void roundToHour () noexcept
 
void roundToDay () noexcept
 
uint64 getNanoseconds () const noexcept
 
void setNanoseconds (uint64 nanoseconds) noexcept
 
unsigned int getNNanoseconds () const noexcept
 
unsigned int getNMicroseconds () const noexcept
 
unsigned int getNMilliseconds () const noexcept
 
unsigned int getNSeconds () const noexcept
 
uint64 getSeconds () const noexcept
 
unsigned int getNMinutes () const noexcept
 
unsigned int getMinutes () const noexcept
 
unsigned int getNHours () const noexcept
 
unsigned int getHours () const noexcept
 
unsigned int getDays () const noexcept
 

Detailed Description

Elapsed time conversion.

This class provides methods for converting nanoseconds into other time units.

Constructor & Destructor Documentation

◆ ElapsedTime() [1/2]

Timer::ElapsedTime::ElapsedTime ( )
inlinenoexcept

Initializes time as 0.

◆ ElapsedTime() [2/2]

Timer::ElapsedTime::ElapsedTime ( uint64  _nanoseconds)
inlinenoexcept

Initializes the time.

Member Function Documentation

◆ getDays()

unsigned int Timer::ElapsedTime::getDays ( ) const
inlinenoexcept

Returns the time in days.

◆ getHours()

unsigned int Timer::ElapsedTime::getHours ( ) const
inlinenoexcept

Returns the time in hours.

◆ getMinutes()

unsigned int Timer::ElapsedTime::getMinutes ( ) const
inlinenoexcept

Returns the time in minutes.

◆ getNanoseconds()

uint64 Timer::ElapsedTime::getNanoseconds ( ) const
inlinenoexcept

Returns the time in nanoseconds.

◆ getNHours()

unsigned int Timer::ElapsedTime::getNHours ( ) const
inlinenoexcept

Returns the time in normalized hours.

◆ getNMicroseconds()

unsigned int Timer::ElapsedTime::getNMicroseconds ( ) const
inlinenoexcept

Returns the time in normalized microseconds.

◆ getNMilliseconds()

unsigned int Timer::ElapsedTime::getNMilliseconds ( ) const
inlinenoexcept

Returns the time in normalized milliseconds.

◆ getNMinutes()

unsigned int Timer::ElapsedTime::getNMinutes ( ) const
inlinenoexcept

Returns the time in normalized minutes.

◆ getNNanoseconds()

unsigned int Timer::ElapsedTime::getNNanoseconds ( ) const
inlinenoexcept

Returns the time in normalized nanoseconds.

◆ getNSeconds()

unsigned int Timer::ElapsedTime::getNSeconds ( ) const
inlinenoexcept

Returns the time in normalized seconds.

◆ getSeconds()

uint64 Timer::ElapsedTime::getSeconds ( ) const
inlinenoexcept

Returns the time in seconds.

◆ roundToDay()

void Timer::ElapsedTime::roundToDay ( )
inlinenoexcept

Round to nearest day. Use this after setting the time and before converting the time.

◆ roundToHour()

void Timer::ElapsedTime::roundToHour ( )
inlinenoexcept

Round to nearest hour. Use this after setting the time and before converting the time.

◆ roundToMicrosecond()

void Timer::ElapsedTime::roundToMicrosecond ( )
inlinenoexcept

Round to nearest microsecond. Use this after setting the time and before converting the time.

◆ roundToMillisecond()

void Timer::ElapsedTime::roundToMillisecond ( )
inlinenoexcept

Round to nearest millisecond. Use this after setting the time and before converting the time.

◆ roundToMinute()

void Timer::ElapsedTime::roundToMinute ( )
inlinenoexcept

Round to nearest minute. Use this after setting the time and before converting the time.

◆ roundToSecond()

void Timer::ElapsedTime::roundToSecond ( )
inlinenoexcept

Round to nearest second. Use this after setting the time and before converting the time.

◆ setNanoseconds()

void Timer::ElapsedTime::setNanoseconds ( uint64  nanoseconds)
inlinenoexcept

Sets the time in nanoseconds.