diff options
author | Nicolas Hillegeer <nicolas@hillegeer.com> | 2014-07-18 11:02:27 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-07-20 16:59:57 -0400 |
commit | fb15cbbaea4ae2b8c75ffa308997f18479135a4f (patch) | |
tree | 42ac2baeee4e2ac71bd7865c398a9a9a46854c2e /src/nvim/ex_cmds2.c | |
parent | ab1eec10a1906cadeed7f480b0d12505a0fba0ad (diff) | |
download | rneovim-fb15cbbaea4ae2b8c75ffa308997f18479135a4f.tar.gz rneovim-fb15cbbaea4ae2b8c75ffa308997f18479135a4f.tar.bz2 rneovim-fb15cbbaea4ae2b8c75ffa308997f18479135a4f.zip |
startuptime: always enable startuptime
Removes the STARTUPTIME define.
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index dc118bb5fe..afbb3b40f1 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2261,10 +2261,6 @@ do_source ( void *save_funccalp; int save_debug_break_level = debug_break_level; scriptitem_T *si = NULL; -#ifdef STARTUPTIME - proftime_T tv_rel; - proftime_T tv_start; -#endif proftime_T wait_start; p = expand_env_save(fname); @@ -2393,10 +2389,13 @@ do_source ( firstline = p; } -#ifdef STARTUPTIME - if (time_fd != NULL) - time_push(&tv_rel, &tv_start); -#endif + // start measuring script load time if --startuptime was passed and + // time_fd was successfully opened afterwards. + proftime_T rel_time; + proftime_T start_time; + if (time_fd != NULL) { + time_push(&rel_time, &start_time); + } if (do_profiling == PROF_YES) prof_child_enter(&wait_start); /* entering a child now */ @@ -2490,13 +2489,12 @@ do_source ( smsg((char_u *)_("continuing in %s"), sourcing_name); verbose_leave(); } -#ifdef STARTUPTIME + if (time_fd != NULL) { vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname); - time_msg((char *)IObuff, &tv_start); - time_pop(tv_rel); + time_msg((char *)IObuff, &start_time); + time_pop(rel_time); } -#endif /* * After a "finish" in debug mode, need to break at first command of next |