mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-14 22:26:46 +02:00
Fix off-by-1000 for GTimer
Divide monotonic time by 1e6 not 1e9 to get seconds.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user