- if (days > 0) sprintf(r, "%ud,%02u:%02u:%02u.%03u", days, hours, minutes, seconds, (unsigned)(dsecs / 1000));
- else if (hours > 0) sprintf(r, "%02u:%02u:%02u.%03u", hours, minutes, seconds, (unsigned)(dsecs / 1000));
- else if (minutes > 0) sprintf(r, "%02u:%02u.%03u", minutes, seconds, (unsigned)(dsecs / 1000));
- else sprintf(r, "%02u.%03u", seconds, (unsigned)(dsecs / 1000));
+ if (days > 0) sprintf(r, "%ud,%02u:%02u:%02u.%04u", days, hours, minutes, seconds, (unsigned)(dsecs / 100));
+ else if (hours > 0) sprintf(r, "%02u:%02u:%02u.%04u", hours, minutes, seconds, (unsigned)(dsecs / 100));
+ else if (minutes > 0) sprintf(r, "%02u:%02u.%04u", minutes, seconds, (unsigned)(dsecs / 100));
+ else sprintf(r, "%02u.%04u", seconds, (unsigned)(dsecs / 100));
+
+ return r;
+}
+
+char *tfc_format_pid(const char *str)
+{
+ static char r[128];
+ size_t n;
+
+ n = xstrlcpy(r, str, sizeof(r));
+ if (show_pid == YES && sizeof(r)-n >= 22) sprintf(r+n, "[%lu]", (unsigned long)progpid);