[glib/wip/monotonic: 7/9] switch GPeriodic to use monotonic time
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/monotonic: 7/9] switch GPeriodic to use monotonic time
- Date: Fri, 22 Oct 2010 17:27:14 +0000 (UTC)
commit f9f56b820855dbbe38c2c585309f762bc10c941d
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Oct 22 19:13:01 2010 +0200
switch GPeriodic to use monotonic time
gio/gperiodic.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gio/gperiodic.c b/gio/gperiodic.c
index 47ea9a8..3eb6983 100644
--- a/gio/gperiodic.c
+++ b/gio/gperiodic.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]