mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01: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;
|
||||
|
||||
total = elapsed / 1e9;
|
||||
total = elapsed / 1e6;
|
||||
|
||||
if (microseconds)
|
||||
*microseconds = (elapsed / 1000) % 1000000;
|
||||
*microseconds = elapsed % 1000000;
|
||||
|
||||
return total;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user