From 641d102101087a3453398800febce2f65f104203 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 14 Feb 2020 16:12:37 +0100 Subject: msg: slightly improve --msg-time output Cut the arbitrary offset, and document what unit/timesource it uses. --- DOCS/man/options.rst | 5 ++++- common/msg.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index bb92751efb..0572b66816 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4233,7 +4233,10 @@ Terminal Prepend module name to each console message. ``--msg-time`` - Prepend timing information to each console message. + Prepend timing information to each console message. The time is in + microseconds 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. Cache ----- diff --git a/common/msg.c b/common/msg.c index a884fa7d5a..871666add0 100644 --- a/common/msg.c +++ b/common/msg.c @@ -282,7 +282,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()); + fprintf(stream, "[%" PRId64 "] ", mp_time_us() - MP_START_TIME); const char *prefix = log->prefix; if ((lev >= MSGL_V) || root->verbose || root->module) -- cgit v1.2.3