mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 7.4.1285
Problem: Cannot measure elapsed time. Solution: Add reltimefloat().
This commit is contained in:
24
src/eval.c
24
src/eval.c
@@ -690,6 +690,9 @@ static void f_pyeval(typval_T *argvars, typval_T *rettv);
|
||||
static void f_range(typval_T *argvars, typval_T *rettv);
|
||||
static void f_readfile(typval_T *argvars, typval_T *rettv);
|
||||
static void f_reltime(typval_T *argvars, typval_T *rettv);
|
||||
#ifdef FEAT_FLOAT
|
||||
static void f_reltimefloat(typval_T *argvars, typval_T *rettv);
|
||||
#endif
|
||||
static void f_reltimestr(typval_T *argvars, typval_T *rettv);
|
||||
static void f_remote_expr(typval_T *argvars, typval_T *rettv);
|
||||
static void f_remote_foreground(typval_T *argvars, typval_T *rettv);
|
||||
@@ -8270,6 +8273,7 @@ static struct fst
|
||||
{"range", 1, 3, f_range},
|
||||
{"readfile", 1, 3, f_readfile},
|
||||
{"reltime", 0, 2, f_reltime},
|
||||
{"reltimefloat", 1, 1, f_reltimefloat},
|
||||
{"reltimestr", 1, 1, f_reltimestr},
|
||||
{"remote_expr", 2, 3, f_remote_expr},
|
||||
{"remote_foreground", 1, 1, f_remote_foreground},
|
||||
@@ -16010,6 +16014,26 @@ f_reltime(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_FLOAT
|
||||
/*
|
||||
* "reltimefloat()" function
|
||||
*/
|
||||
static void
|
||||
f_reltimefloat(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
# ifdef FEAT_RELTIME
|
||||
proftime_T tm;
|
||||
# endif
|
||||
|
||||
rettv->v_type = VAR_FLOAT;
|
||||
rettv->vval.v_float = 0;
|
||||
# ifdef FEAT_RELTIME
|
||||
if (list2proftime(&argvars[0], &tm) == OK)
|
||||
rettv->vval.v_float = profile_float(&tm);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "reltimestr()" function
|
||||
*/
|
||||
|
Reference in New Issue
Block a user