Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HardwareTimersLib by
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:
-
h number 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:
-
m number 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:
-
ms number 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:
-
ns number 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:
-
s number 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:
-
us number 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:
-
obj the 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:
-
obj the 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:
-
obj the 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:
-
obj the 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:
-
obj the 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:
-
obj the object to convert
- Returns:
- value of obj in us
Definition at line 41 of file PreciseTime.cpp.
Generated on Tue Jul 12 2022 20:37:48 by
1.7.2
