From fb3facf05268b43dbdf31994cb8a7ee192883874 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 18 Sep 2020 14:26:10 +0200 Subject: [PATCH] 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). --- DOCS/man/options.rst | 2 +- common/msg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index b2e41bca76..ed0b38c719 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -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. diff --git a/common/msg.c b/common/msg.c index 7f8754b308..7e271d1b8b 100644 --- a/common/msg.c +++ b/common/msg.c @@ -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)