From 843eef65b8d2787482f153a67baf4614b0bef043 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 9 Jun 2019 18:48:52 +0200 Subject: [PATCH] tweaks: put some timing code back into the search function --- src/search.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/search.c b/src/search.c index 1dd48aca..b64375ca 100644 --- a/src/search.c +++ b/src/search.c @@ -396,6 +396,12 @@ void go_looking(void) linestruct *was_current = openfile->current; size_t was_current_x = openfile->current_x; +//#define TIMEIT 12 +#ifdef TIMEIT +#include + clock_t start = clock(); +#endif + came_full_circle = FALSE; didfind = findnextstr(last_search, FALSE, JUSTFIND, NULL, TRUE, @@ -409,6 +415,10 @@ void go_looking(void) else if (didfind == 0) not_found_msg(last_search); +#ifdef TIMEIT + statusline(HUSH, "Took: %.2f", (double)(clock() - start) / CLOCKS_PER_SEC); +#endif + edit_redraw(was_current, CENTERING); }