render: presentation: also use seconds when calculating frame interval count

This commit is contained in:
Daniel Eklöf 2019-12-31 20:04:44 +01:00
parent dd3e9346cf
commit a45786ef1b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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++;