terminal: print debug warning when skipping frames
authorDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 4 Sep 2012 16:42:31 +0000 (18:42 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Tue, 4 Sep 2012 16:42:31 +0000 (18:42 +0200)
If the CPU is too slow to render the console in a decent speed and we have
to skip frames, then we should print warnings if debug mode is on.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/terminal.c

index 99e7a52..ac48677 100644 (file)
@@ -115,6 +115,9 @@ static void redraw_timer_event(struct ev_timer *timer, uint64_t num, void *data)
         * fps-timeouts for 1s is really faster than calling
         * ev_timer_enable/disable() all the time. */
 
+       if (num > 1)
+               log_debug("CPU is too slow; skipping %llu frames", num - 1);
+
        if (term->redraw-- != term->fps) {
                if (!term->redraw) {
                        ev_timer_disable(term->redraw_timer);