[wpiutil] Add GetSystemTime() (#3840)

This portably gets the time in microseconds since the Unix epoch.
This commit is contained in:
Peter Johnson
2021-12-28 01:06:31 -06:00
committed by GitHub
parent 1e82595ffb
commit 5999a26fba
4 changed files with 41 additions and 3 deletions

View File

@@ -33,6 +33,14 @@ void WPI_SetNowImpl(uint64_t (*func)(void));
*/
uint64_t WPI_Now(void);
/**
* Return the current system time in microseconds since the Unix epoch
* (January 1st, 1970 00:00 UTC).
*
* @return Time in microseconds.
*/
uint64_t WPI_GetSystemTime(void);
#ifdef __cplusplus
} // extern "C"
#endif
@@ -62,6 +70,14 @@ void SetNowImpl(uint64_t (*func)());
*/
uint64_t Now(void);
/**
* Return the current system time in microseconds since the Unix epoch
* (January 1st, 1970 00:00 UTC).
*
* @return Time in microseconds.
*/
uint64_t GetSystemTime();
} // namespace wpi
#endif