1
0
forked from aniani/vim

updated for version 7.0231

This commit is contained in:
Bram Moolenaar
2006-03-21 21:29:36 +00:00
parent 76916e60ed
commit 433f7c88d5
14 changed files with 502 additions and 97 deletions

View File

@@ -809,29 +809,7 @@ dbg_breakpoint(name, lnum)
}
# if defined(FEAT_PROFILE) || defined(PROTO)
/*
* Functions for profiling.
*/
static void script_do_profile __ARGS((scriptitem_T *si));
static void script_dump_profile __ARGS((FILE *fd));
static proftime_T prof_wait_time;
/*
* Set the time in "tm" to zero.
*/
void
profile_zero(tm)
proftime_T *tm;
{
# ifdef WIN3264
tm->QuadPart = 0;
# else
tm->tv_usec = 0;
tm->tv_sec = 0;
# endif
}
# if defined(FEAT_PROFILE) || defined(FEAT_RELTIME) || defined(PROTO)
/*
* Store the current time in "tm".
*/
@@ -890,6 +868,52 @@ profile_sub(tm, tm2)
# endif
}
/*
* Return a string that represents the time in "tm".
* Uses a static buffer!
*/
char *
profile_msg(tm)
proftime_T *tm;
{
static char buf[50];
# ifdef WIN3264
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
# else
sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
#endif
return buf;
}
# endif /* FEAT_PROFILE || FEAT_RELTIME */
# if defined(FEAT_PROFILE) || defined(PROTO)
/*
* Functions for profiling.
*/
static void script_do_profile __ARGS((scriptitem_T *si));
static void script_dump_profile __ARGS((FILE *fd));
static proftime_T prof_wait_time;
/*
* Set the time in "tm" to zero.
*/
void
profile_zero(tm)
proftime_T *tm;
{
# ifdef WIN3264
tm->QuadPart = 0;
# else
tm->tv_usec = 0;
tm->tv_sec = 0;
# endif
}
/*
* Add the time "tm2" to "tm".
*/
@@ -985,27 +1009,6 @@ profile_cmp(tm1, tm2)
# endif
}
/*
* Return a string that represents a time.
* Uses a static buffer!
*/
char *
profile_msg(tm)
proftime_T *tm;
{
static char buf[50];
# ifdef WIN3264
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart);
# else
sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec);
#endif
return buf;
}
static char_u *profile_fname = NULL;
static proftime_T pause_time;