GUACAMOLE-239: Merge support for CLOCK_MONOTONIC.
This commit is contained in:
commit
039a1c52e4
@ -33,8 +33,12 @@ guac_timestamp guac_timestamp_current() {
|
||||
|
||||
struct timespec current;
|
||||
|
||||
/* Get current time */
|
||||
/* Get current time, monotonically increasing */
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
clock_gettime(CLOCK_MONOTONIC, ¤t);
|
||||
#else
|
||||
clock_gettime(CLOCK_REALTIME, ¤t);
|
||||
#endif
|
||||
|
||||
/* Calculate milliseconds */
|
||||
return (guac_timestamp) current.tv_sec * 1000 + current.tv_nsec / 1000000;
|
||||
|
Loading…
Reference in New Issue
Block a user