From a45786ef1b51ea26fb9d14dbaf521738035a9f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 31 Dec 2019 20:04:44 +0100 Subject: [PATCH] render: presentation: also use seconds when calculating frame interval count --- render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render.c b/render.c index 8651c99f..30074d07 100644 --- a/render.c +++ b/render.c @@ -98,9 +98,9 @@ presented(void *data, "presented (total: %luµs)", diff.tv_usec); unsigned frame_count = 0; - if (diff.tv_sec == 0 && tll_length(term->window->on_outputs) > 0) { + if (tll_length(term->window->on_outputs) > 0) { const struct monitor *mon = tll_front(term->window->on_outputs); - frame_count = (double)diff.tv_usec / (1. / mon->refresh * 1000000.); + frame_count = (double)(diff.tv_sec * 1000000 + diff.tv_usec) / (1. / mon->refresh * 1000000.); } presentation_statistics.total++;