commit 843eef65b8d2787482f153a67baf4614b0bef043
parent 781c7a7a5f88dd7c42cca3b994be15d41f177d33
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 9 Jun 2019 18:48:52 +0200
tweaks: put some timing code back into the search function
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git 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 <time.h>
+ 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);
}