# TIME
[PLATFORM]

Collaboration diagram for TIME:

## Enumerations
enum | time_origin_t { SINCE_BOOT, SINCE_EPOCH }
| Time origin. More...
## Functions
void | time_init (uint32_t sec, uint32_t usec)
| Initialize time.
int | get_time (enum time_origin_t origin, uint32_t *sec, uint32_t *usec)
| Get current time.
int | get_time_us (enum time_origin_t origin, uint64_t *usec)
| Get current time.

## Enumeration Type Documentation

enum time_origin_t

Time origin.

Enumerator:

  SINCE_BOOT | Since boot time.
  SINCE_EPOCH | Since Epoch : 1970-01-01 00:00:00 +0000 (UTC).

Definition at line 26 of file nx_time.h.

## Function Documentation

int get_time | ( | enum time_origin_t | origin,
|  | uint32_t * | sec,
|  | uint32_t * | usec |
| ) |  |  |

Get current time.

return the current time, from the selected origin, in a sec/usec split.

Parameters:

  `[in]` | origin | Select the time origin (Since boot or since Epoch)
  `[out]` | sec | Udapted with the number of seconds since the selected origin.
  `[out]` | usec | Updated with the number of microseconds since the selected origin. (excluding the seconds in sec)

Returns:
  0 on success and != 0 otherwise.

int get_time_us | ( | enum time_origin_t | origin,
|  | uint64_t * | usec |
| ) |  |  |

Get current time.

return the current time, from the selected origin, in usec.

Parameters:

  `[in]` | origin | Select the time origin (Since boot or since Epoch)
  `[out]` | usec | Updated with the number of microseconds since the selected origin.

Returns:
  0 on success and != 0 otherwise.

void time_init | ( | uint32_t | sec,
|  | uint32_t | usec |
| ) |  |  |

Initialize time.

Parameters:

  `[in]` | sec | Number of seconds since Epoch when the system started.
  `[in]` | usec | Number of microseconds since Epoch when the system started (excluding the seconds in sec).