Index: src/nano.c =================================================================== --- src/nano.c (revision 5225) +++ src/nano.c (working copy) @@ -33,6 +33,8 @@ #include #include #include +#include + #ifdef ENABLE_UTF8 #include #endif @@ -1683,6 +1685,12 @@ } if (have_shortcut) { + + struct timeval t1, t2; + int duration; + + gettimeofday(&t1, 0); + /* If the function associated with this shortcut is * cutting or copying text, remember this. */ if (s->scfunc == do_cut_text_void @@ -1712,6 +1720,10 @@ && openfile->syntax->nmultis > 0) reset_multis(openfile->current, FALSE); #endif + gettimeofday(&t2, 0); + duration = (t2.tv_sec - t1.tv_sec) * 1000 + (t2.tv_usec - t1.tv_usec) / 1000; + fprintf(stderr, "Function %x took %i milliseconds.\n", s->scfunc, duration); + if (edit_refresh_needed) { #ifdef DEBUG fprintf(stderr, "running edit_refresh() as edit_refresh_needed is true\n");