NanoTime::TimeValue Struct Reference

A time time broken into its constituent elements. More...

#include <NanoTime.h>

Collaboration diagram for NanoTime::TimeValue:

Public Member Functions

 TimeValue ()=default
 
template<typename TimeType >
 TimeValue (Unit unit, TimeType time)
 Resolve a time value into constituent components. More...
 
template<typename TimeType >
void set (Unit unit, TimeType time)
 
uint32_t getMicroseconds () const
 Get sub-second time entirely in microseconds. More...
 
uint32_t getNanoseconds () const
 Get sub-second time entirely in nanoseconds. More...
 
String toString () const
 
 operator String () const
 

Public Attributes

bool overflow = false
 
Unit unit = Seconds
 Time unit passed to set() call. More...
 
uint32_t days = 0
 
uint8_t hours = 0
 
uint8_t minutes = 0
 
uint8_t seconds = 0
 
uint16_t milliseconds = 0
 
uint32_t microseconds = 0
 
uint32_t nanoseconds = 0
 

Detailed Description

A time time broken into its constituent elements.

Note
Useful for analysing and printing time values

Constructor & Destructor Documentation

◆ TimeValue() [1/2]

NanoTime::TimeValue::TimeValue ( )
default

◆ TimeValue() [2/2]

template<typename TimeType >
NanoTime::TimeValue::TimeValue ( Unit  unit,
TimeType  time 
)
inline

Resolve a time value into constituent components.

Parameters
timeThe time to resolve
unitUnits for given time

Member Function Documentation

◆ getMicroseconds()

uint32_t NanoTime::TimeValue::getMicroseconds ( ) const
inline

Get sub-second time entirely in microseconds.

◆ getNanoseconds()

uint32_t NanoTime::TimeValue::getNanoseconds ( ) const
inline

Get sub-second time entirely in nanoseconds.

◆ operator String()

NanoTime::TimeValue::operator String ( ) const
inline

◆ set()

template<typename TimeType >
void NanoTime::TimeValue::set ( Unit  unit,
TimeType  time 
)

◆ toString()

String NanoTime::TimeValue::toString ( ) const

Member Data Documentation

◆ days

uint32_t NanoTime::TimeValue::days = 0

◆ hours

uint8_t NanoTime::TimeValue::hours = 0

◆ microseconds

uint32_t NanoTime::TimeValue::microseconds = 0

◆ milliseconds

uint16_t NanoTime::TimeValue::milliseconds = 0

◆ minutes

uint8_t NanoTime::TimeValue::minutes = 0

◆ nanoseconds

uint32_t NanoTime::TimeValue::nanoseconds = 0

◆ overflow

bool NanoTime::TimeValue::overflow = false

◆ seconds

uint8_t NanoTime::TimeValue::seconds = 0

◆ unit

Unit NanoTime::TimeValue::unit = Seconds

Time unit passed to set() call.


The documentation for this struct was generated from the following file: