mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
switch GPeriodic to use monotonic time
This commit is contained in:
parent
91113a8aee
commit
d3fe2efb83
@ -114,13 +114,13 @@ static guint64
|
||||
g_periodic_get_microticks (GPeriodic *periodic)
|
||||
{
|
||||
guint64 microticks;
|
||||
GTimeVal timeval;
|
||||
GTimeSpec timespec;
|
||||
|
||||
g_source_get_current_time (periodic->source, &timeval);
|
||||
g_source_get_time (periodic->source, ×pec);
|
||||
|
||||
microticks = timeval.tv_sec;
|
||||
microticks = timespec.tv_sec;
|
||||
microticks *= 1000000;
|
||||
microticks += timeval.tv_usec;
|
||||
microticks += timespec.tv_nsec / 1000;
|
||||
microticks *= periodic->hz;
|
||||
|
||||
return microticks;
|
||||
|
Loading…
Reference in New Issue
Block a user