commit 208995e4a787ef2c2ae71c25260568b8a7e60bd4
parent b503670750cb2be8fb2b7ecab32f68ab10d43b4f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 30 Apr 2019 10:11:29 +0200
tweaks: move a bit of timing code to where it will be needed
Diffstat:
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -439,15 +439,8 @@ void ingraft_buffer(linestruct *somebuffer)
}
#endif
-#ifdef DEBUG
-#include <time.h>
- clock_t start = clock();
-#endif
/* Add the number of characters in the copied text to the file size. */
openfile->totsize += get_totsize(openfile->filetop, openfile->filebot);
-#ifdef DEBUG
- statusline(ALERT, "Took: %.2f", (double)(clock() - start) / CLOCKS_PER_SEC);
-#endif
/* If we pasted onto the first line of the edit window, the corresponding
* record has been freed, so... point at the start of the copied text. */
@@ -2355,8 +2348,18 @@ int main(int argc, char **argv)
#ifdef ENABLE_SPELLER
alt_speller = NULL;
#endif
+
+//#define TIMEIT 12
+#ifdef TIMEIT
+#include <time.h>
+ clock_t start = clock();
+#endif
/* Now process the system's and the user's nanorc file, if any. */
do_rcfiles();
+#ifdef TIMEIT
+ fprintf(stderr, "Took: %.3f\n",
+ (double)(clock() - start) / CLOCKS_PER_SEC);
+#endif
#ifdef DEBUG
fprintf(stderr, "After rebinding keys...\n");