mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
updated for version 7.2-269
This commit is contained in:
62
src/main.c
62
src/main.c
@@ -130,10 +130,6 @@ static char_u *serverMakeName __ARGS((char_u *arg, char *cmd));
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
static FILE *time_fd = NULL;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Different types of error messages.
|
||||
*/
|
||||
@@ -173,6 +169,9 @@ main
|
||||
char_u *fname = NULL; /* file name from command line */
|
||||
mparm_T params; /* various parameters passed between
|
||||
* main() and other functions. */
|
||||
#ifdef STARTUPTIME
|
||||
int i;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Do any system-specific initialisations. These can NOT use IObuff or
|
||||
@@ -203,8 +202,15 @@ main
|
||||
#endif
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
time_fd = mch_fopen(STARTUPTIME, "a");
|
||||
TIME_MSG("--- VIM STARTING ---");
|
||||
for (i = 1; i < argc; ++i)
|
||||
{
|
||||
if (STRNICMP(argv[i], "--startuptime=", 14) == 0)
|
||||
{
|
||||
time_fd = mch_fopen(argv[i] + 14, "a");
|
||||
TIME_MSG("--- VIM STARTING ---");
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
starttime = time(NULL);
|
||||
|
||||
@@ -1150,6 +1156,18 @@ main_loop(cmdwin, noexmode)
|
||||
cursor_on();
|
||||
|
||||
do_redraw = FALSE;
|
||||
|
||||
#ifdef STARTUPTIME
|
||||
/* Now that we have drawn the first screen all the startup stuff
|
||||
* has been done, close any file for startup messages. */
|
||||
if (time_fd != NULL)
|
||||
{
|
||||
TIME_MSG("first screen update");
|
||||
TIME_MSG("--- VIM STARTED ---");
|
||||
fclose(time_fd);
|
||||
time_fd = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_GUI
|
||||
if (need_mouse_correct)
|
||||
@@ -1743,6 +1761,10 @@ command_line_scan(parmp)
|
||||
/* already processed, skip */
|
||||
}
|
||||
#endif
|
||||
else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
|
||||
{
|
||||
/* already processed, skip */
|
||||
}
|
||||
else
|
||||
{
|
||||
if (argv[0][argv_idx])
|
||||
@@ -3211,6 +3233,20 @@ static void time_diff __ARGS((struct timeval *then, struct timeval *now));
|
||||
|
||||
static struct timeval prev_timeval;
|
||||
|
||||
# ifdef WIN3264
|
||||
/*
|
||||
* Windows doesn't have gettimeofday(), although it does have struct timeval.
|
||||
*/
|
||||
static int
|
||||
gettimeofday(struct timeval *tv, char *dummy)
|
||||
{
|
||||
long t = clock();
|
||||
tv->tv_sec = t / CLOCKS_PER_SEC;
|
||||
tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC;
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Save the previous time before doing something that could nest.
|
||||
* set "*tv_rel" to the time elapsed so far.
|
||||
@@ -3299,20 +3335,6 @@ time_msg(msg, tv_start)
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef WIN3264
|
||||
/*
|
||||
* Windows doesn't have gettimeofday(), although it does have struct timeval.
|
||||
*/
|
||||
int
|
||||
gettimeofday(struct timeval *tv, char *dummy)
|
||||
{
|
||||
long t = clock();
|
||||
tv->tv_sec = t / CLOCKS_PER_SEC;
|
||||
tv->tv_usec = (t - tv->tv_sec * CLOCKS_PER_SEC) * 1000000 / CLOCKS_PER_SEC;
|
||||
return 0;
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CLIENTSERVER) || defined(PROTO)
|
||||
|
Reference in New Issue
Block a user