mirror of https://gerrit.osmocom.org/libosmocore
Expand osmo_gettimeofday() docs
Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Related: OS#2586
This commit is contained in:
parent
4b45669761
commit
1fa8dfbaf4
|
@ -33,7 +33,13 @@ struct timeval osmo_gettimeofday_override_time = { 23, 424242 };
|
|||
|
||||
/*! shim around gettimeofday to be able to set the time manually.
|
||||
* To override, set osmo_gettimeofday_override == true and set the desired
|
||||
* current time in osmo_gettimeofday_override_time. */
|
||||
* current time in osmo_gettimeofday_override_time.
|
||||
*
|
||||
* N. B: gettimeofday() is affected by discontinuous jumps in the system time
|
||||
* (e.g., if the system administrator manually changes the system time).
|
||||
* Hence this should NEVER be used for elapsed time computation.
|
||||
* Instead, clock_gettime(CLOCK_MONOTONIC, ..) should be used for that (with similar shim if necessary).
|
||||
*/
|
||||
int osmo_gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||
{
|
||||
if (osmo_gettimeofday_override) {
|
||||
|
|
Loading…
Reference in New Issue