From a13750209b3836a4a6a16a7ba881625f397f160f Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 7 Mar 2024 20:19:26 +0100 Subject: Implement timers properly The timers shown with `M-x timers` are now actual timings. --- src/dged/display.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dged/display.c') diff --git a/src/dged/display.c b/src/dged/display.c index 85a6e0b..ed6fc00 100644 --- a/src/dged/display.c +++ b/src/dged/display.c @@ -2,6 +2,7 @@ #include "display.h" #include "buffer.h" +#include "timers.h" #include "utf8.h" #include @@ -358,6 +359,10 @@ void display_render(struct display *display, struct command_list *command_list) { struct command_list *cl = command_list; + static char name[32] = {0}; + snprintf(name, 31, "display.cl.%s", cl->name); + struct timer *render_timer = timer_start(name); + uint8_t fmt_stack[256] = {0}; fmt_stack[0] = ESC; fmt_stack[1] = '['; @@ -419,6 +424,8 @@ void display_render(struct display *display, } cl = cl->next_list; } + + timer_stop(render_timer); } void hide_cursor() { -- cgit v1.2.3