Mark Gottscho / HardwareTimersLib

Fork of HardwareTimersLib by Mark Gottscho

Embed: (wiki syntax)

« Back to documentation index

PreciseTime Class Reference

This class provides a simple abstraction for time-keeping in a wall-clock sense. More...

#include <PreciseTime.h>

Public Member Functions

void print ()
 Prints an ASCII representation of this object.

Static Public Member Functions

static uint32_t to_h (PreciseTime obj)
 Convert a PreciseTime object to hours.
static uint32_t to_m (PreciseTime obj)
 Convert a PreciseTime object to minutes.
static uint32_t to_s (PreciseTime obj)
 Convert a PreciseTime object to seconds.
static uint32_t to_ms (PreciseTime obj)
 Convert a PreciseTime object to ms.
static uint32_t to_us (PreciseTime obj)
 Convert a PreciseTime object to us.
static uint32_t to_ns (PreciseTime obj)
 Convert a PreciseTime object to ns.
static PreciseTime from_h (uint32_t h)
 Convert an integer number of hours to a PreciseTime representation.
static PreciseTime from_m (uint32_t m)
 Convert an integer number of minutes to a PreciseTime representation.
static PreciseTime from_s (uint32_t s)
 Convert an integer number of seconds to a PreciseTime representation.
static PreciseTime from_ms (uint32_t ms)
 Convert an integer number of ms to a PreciseTime representation.
static PreciseTime from_us (uint32_t us)
 Convert an integer number of us to a PreciseTime representation.
static PreciseTime from_ns (uint32_t ns)
 Convert an integer number of ns to a PreciseTime representation.

Detailed Description

This class provides a simple abstraction for time-keeping in a wall-clock sense.

It can store time by hour:min:sec:ms:us:ns, and convert time counts into a wall-clock time and vice versa.

Definition at line 17 of file PreciseTime.h.


Member Function Documentation

PreciseTime from_h ( uint32_t  h ) [static]

Convert an integer number of hours to a PreciseTime representation.

Parameters:
hnumber of hours
Returns:
the PreciseTime representation

Definition at line 49 of file PreciseTime.cpp.

PreciseTime from_m ( uint32_t  m ) [static]

Convert an integer number of minutes to a PreciseTime representation.

Parameters:
mnumber of minutes
Returns:
the PreciseTime representation

Definition at line 55 of file PreciseTime.cpp.

PreciseTime from_ms ( uint32_t  ms ) [static]

Convert an integer number of ms to a PreciseTime representation.

Parameters:
msnumber of ms
Returns:
the PreciseTime representation

Definition at line 72 of file PreciseTime.cpp.

PreciseTime from_ns ( uint32_t  ns ) [static]

Convert an integer number of ns to a PreciseTime representation.

Parameters:
nsnumber of ns
Returns:
the PreciseTime representation

Definition at line 101 of file PreciseTime.cpp.

PreciseTime from_s ( uint32_t  s ) [static]

Convert an integer number of seconds to a PreciseTime representation.

Parameters:
snumber of seconds
Returns:
the PreciseTime representation

Definition at line 62 of file PreciseTime.cpp.

PreciseTime from_us ( uint32_t  us ) [static]

Convert an integer number of us to a PreciseTime representation.

Parameters:
usnumber of us
Returns:
the PreciseTime representation

Definition at line 85 of file PreciseTime.cpp.

void print (  )

Prints an ASCII representation of this object.

Definition at line 20 of file PreciseTime.cpp.

uint32_t to_h ( PreciseTime  obj ) [static]

Convert a PreciseTime object to hours.

Parameters:
objthe object to convert
Returns:
value of obj in hours

Definition at line 25 of file PreciseTime.cpp.

uint32_t to_m ( PreciseTime  obj ) [static]

Convert a PreciseTime object to minutes.

Parameters:
objthe object to convert
Returns:
value of obj in minutes

Definition at line 29 of file PreciseTime.cpp.

uint32_t to_ms ( PreciseTime  obj ) [static]

Convert a PreciseTime object to ms.

Parameters:
objthe object to convert
Returns:
value of obj in ms

Definition at line 37 of file PreciseTime.cpp.

uint32_t to_ns ( PreciseTime  obj ) [static]

Convert a PreciseTime object to ns.

Parameters:
objthe object to convert
Returns:
value of obj in ns

Definition at line 45 of file PreciseTime.cpp.

uint32_t to_s ( PreciseTime  obj ) [static]

Convert a PreciseTime object to seconds.

Parameters:
objthe object to convert
Returns:
value of obj in seconds

Definition at line 33 of file PreciseTime.cpp.

uint32_t to_us ( PreciseTime  obj ) [static]

Convert a PreciseTime object to us.

Parameters:
objthe object to convert
Returns:
value of obj in us

Definition at line 41 of file PreciseTime.cpp.