0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.1285

Problem:    Cannot measure elapsed time.
Solution:   Add reltimefloat().
This commit is contained in:
Bram Moolenaar
2016-02-07 21:19:28 +01:00
parent dc94a26a64
commit 79c2c881bb
5 changed files with 46 additions and 0 deletions

View File

@@ -1010,6 +1010,24 @@ profile_msg(proftime_T *tm)
return buf;
}
# if defined(FEAT_FLOAT) || defined(PROTO)
/*
* Return a float that represents the time in "tm".
*/
float_T
profile_float(proftime_T *tm)
{
# ifdef WIN3264
LARGE_INTEGER fr;
QueryPerformanceFrequency(&fr);
return (float_T)tm->QuadPart / (float_T)fr.QuadPart;
# else
return (float_T)tm->tv_sec + (float_T)tm->tv_usec / 1000000.0;
# endif
}
# endif
/*
* Put the time "msec" past now in "tm".
*/