/* Returns: seconds elapsed as a floating point value, including any fractional part.  */
gdouble g_timer_elapsed(GTimer *timer, gulong *microseconds)
/* Returns: seconds elapsed as a floating point value, including any fractional part.  */
gdouble g_timer_elapsed(GTimer *timer, gulong *microseconds)
{
  gdouble total;
  gint64 elapsed;
  g_return_val_if_fail (timer != NULL, 0);
  if (timer->active)
    timer->end = g_get_monotonic_time ();
  elapsed = timer->end - timer->start;
  total = elapsed / 1e6;
  if (microseconds)
    *microseconds = elapsed % 1000000;
  return total;
}