mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
format: improve string formatting for smaller timings
This commit is contained in:
@ -634,9 +634,9 @@ _sysprof_format_duration (gint64 duration)
|
|||||||
duration = ABS (duration);
|
duration = ABS (duration);
|
||||||
|
|
||||||
if (duration < SYSPROF_NSEC_PER_SEC)
|
if (duration < SYSPROF_NSEC_PER_SEC)
|
||||||
return g_strdup_printf ("%s%.2lf msec",
|
return g_strdup_printf ("%s%.3lf msec",
|
||||||
negative ? "-" : "",
|
negative ? "-" : "",
|
||||||
(duration / 1000000.0));
|
(duration / (gdouble)SYSPROF_NSEC_PER_SEC * 1000L));
|
||||||
else
|
else
|
||||||
return g_strdup_printf ("%s%.4lf seconds",
|
return g_strdup_printf ("%s%.4lf seconds",
|
||||||
negative ? "-" : "",
|
negative ? "-" : "",
|
||||||
|
|||||||
Reference in New Issue
Block a user