From 208995e4a787ef2c2ae71c25260568b8a7e60bd4 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 30 Apr 2019 10:11:29 +0200 Subject: [PATCH] tweaks: move a bit of timing code to where it will be needed --- src/nano.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/nano.c b/src/nano.c index 167b0e32..e28ca610 100644 --- a/src/nano.c +++ b/src/nano.c @@ -439,15 +439,8 @@ void ingraft_buffer(linestruct *somebuffer) } #endif -#ifdef DEBUG -#include - 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 + 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");