mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-gtk: simplify time to string output
This commit is contained in:
@ -249,6 +249,12 @@ format_time_offset (gpointer cell)
|
|||||||
minutes = time / 60;
|
minutes = time / 60;
|
||||||
time -= minutes * 60;
|
time -= minutes * 60;
|
||||||
|
|
||||||
|
if (hours == 0 && minutes == 0)
|
||||||
|
return g_strdup_printf ("%.4lf", time);
|
||||||
|
|
||||||
|
if (hours == 0)
|
||||||
|
return g_strdup_printf ("%02d:%02.4lf", minutes, time);
|
||||||
|
|
||||||
return g_strdup_printf ("%02d:%02d:%02.4lf", hours, minutes, time);
|
return g_strdup_printf ("%02d:%02d:%02.4lf", hours, minutes, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user