diff options
Diffstat (limited to 'src/nvim/profile.c')
-rw-r--r-- | src/nvim/profile.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/nvim/profile.c b/src/nvim/profile.c index b88b08d3f0..81207b4e39 100644 --- a/src/nvim/profile.c +++ b/src/nvim/profile.c @@ -10,6 +10,7 @@ #include "nvim/charset.h" #include "nvim/cmdexpand_defs.h" #include "nvim/debugger.h" +#include "nvim/errors.h" #include "nvim/eval.h" #include "nvim/eval/typval_defs.h" #include "nvim/eval/userfunc.h" @@ -382,19 +383,19 @@ void set_context_in_profile_cmd(expand_T *xp, const char *arg) xp->xp_context = EXPAND_NOTHING; } -static proftime_T inchar_time; +static proftime_T wait_time; /// Called when starting to wait for the user to type a character. -void prof_inchar_enter(void) +void prof_input_start(void) { - inchar_time = profile_start(); + wait_time = profile_start(); } /// Called when finished waiting for the user to type a character. -void prof_inchar_exit(void) +void prof_input_end(void) { - inchar_time = profile_end(inchar_time); - profile_set_wait(profile_add(profile_get_wait(), inchar_time)); + wait_time = profile_end(wait_time); + profile_set_wait(profile_add(profile_get_wait(), wait_time)); } /// @return true when a function defined in the current script should be @@ -949,8 +950,8 @@ void time_msg(const char *mesg, const proftime_T *start) /// Initializes the `time_fd` stream for the --startuptime report. /// /// @param fname startuptime report file path -/// @param process_name name of the current Nvim process to write in the report. -void time_init(const char *fname, const char *process_name) +/// @param proc_name name of the current Nvim process to write in the report. +void time_init(const char *fname, const char *proc_name) { const size_t bufsize = 8192; // Big enough for the entire --startuptime report. time_fd = fopen(fname, "a"); @@ -971,7 +972,7 @@ void time_init(const char *fname, const char *process_name) semsg("time_init: setvbuf failed: %d %s", r, uv_err_name(r)); return; } - fprintf(time_fd, "--- Startup times for process: %s ---\n", process_name); + fprintf(time_fd, "--- Startup times for process: %s ---\n", proc_name); } /// Flushes the startuptimes to disk for the current process |