msg: make --msg-time show time in seconds

More readable, similar to what --log-file will use (although the
terminal code shows microseconds and uses less left padding).
This commit is contained in:
wm4 2020-09-18 14:26:10 +02:00
parent f4c39c74d4
commit fb3facf052
2 changed files with 2 additions and 2 deletions

View File

@ -4493,7 +4493,7 @@ Terminal
``--msg-time``
Prepend timing information to each console message. The time is in
microseconds since the player process was started (technically, slightly
seconds since the player process was started (technically, slightly
later actually), using a monotonic time source depending on the OS. This
is ``CLOCK_MONOTONIC`` on sane UNIX variants.

View File

@ -306,7 +306,7 @@ static void print_terminal_line(struct mp_log *log, int lev,
set_msg_color(stream, lev);
if (root->show_time)
fprintf(stream, "[%" PRId64 "] ", mp_time_us() - MP_START_TIME);
fprintf(stream, "[%10.6f] ", (mp_time_us() - MP_START_TIME) / 1e6);
const char *prefix = log->prefix;
if ((lev >= MSGL_V) || root->verbose || root->module)