projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab3a79e
)
Fix off-by-1000 for GTimer
author
Owen W. Taylor
<otaylor@fishsoup.net>
Mon, 22 Nov 2010 02:59:57 +0000
(21:59 -0500)
committer
Owen W. Taylor
<otaylor@fishsoup.net>
Mon, 22 Nov 2010 03:01:52 +0000
(22:01 -0500)
Divide monotonic time by 1e6 not 1e9 to get seconds.
glib/gtimer.c
patch
|
blob
|
history
diff --git
a/glib/gtimer.c
b/glib/gtimer.c
index
04f830c
..
0395fb0
100644
(file)
--- a/
glib/gtimer.c
+++ b/
glib/gtimer.c
@@
-233,10
+233,10
@@
g_timer_elapsed (GTimer *timer,
elapsed = timer->end - timer->start;
- total = elapsed / 1e
9
;
+ total = elapsed / 1e
6
;
if (microseconds)
- *microseconds =
(elapsed / 1000)
% 1000000;
+ *microseconds =
elapsed
% 1000000;
return total;
}