mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-23 15:49:16 +02:00
Fix off-by-1000 for GTimer
Divide monotonic time by 1e6 not 1e9 to get seconds.
This commit is contained in:
parent
ab3a79e2c9
commit
a70ba9c8b1
@ -233,10 +233,10 @@ g_timer_elapsed (GTimer *timer,
|
|||||||
|
|
||||||
elapsed = timer->end - timer->start;
|
elapsed = timer->end - timer->start;
|
||||||
|
|
||||||
total = elapsed / 1e9;
|
total = elapsed / 1e6;
|
||||||
|
|
||||||
if (microseconds)
|
if (microseconds)
|
||||||
*microseconds = (elapsed / 1000) % 1000000;
|
*microseconds = elapsed % 1000000;
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user