mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +00:00
vim-patch:7.4.1285
Problem: Cannot measure elapsed time.
Solution: Add reltimefloat().
79c2c881bb
Applied manually. None of the ifdef's applies anymore, and proftime_T was
changed into an uint64_T, so the function profile_float to convert proftime_T to
float is not needed in nvim.
This commit is contained in:
@@ -6850,6 +6850,7 @@ static struct fst {
|
|||||||
{ "range", 1, 3, f_range },
|
{ "range", 1, 3, f_range },
|
||||||
{ "readfile", 1, 3, f_readfile },
|
{ "readfile", 1, 3, f_readfile },
|
||||||
{ "reltime", 0, 2, f_reltime },
|
{ "reltime", 0, 2, f_reltime },
|
||||||
|
{ "reltimefloat", 1, 1, f_reltimefloat },
|
||||||
{ "reltimestr", 1, 1, f_reltimestr },
|
{ "reltimestr", 1, 1, f_reltimestr },
|
||||||
{ "remove", 2, 3, f_remove },
|
{ "remove", 2, 3, f_remove },
|
||||||
{ "rename", 2, 2, f_rename },
|
{ "rename", 2, 2, f_rename },
|
||||||
@@ -15296,6 +15297,21 @@ static void f_uniq(typval_T *argvars, typval_T *rettv)
|
|||||||
do_sort_uniq(argvars, rettv, false);
|
do_sort_uniq(argvars, rettv, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// "reltimefloat()" function
|
||||||
|
//
|
||||||
|
static void f_reltimefloat(typval_T *argvars , typval_T *rettv)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
|
{
|
||||||
|
proftime_T tm;
|
||||||
|
|
||||||
|
rettv->v_type = VAR_FLOAT;
|
||||||
|
rettv->vval.v_float = 0;
|
||||||
|
if (list2proftime(&argvars[0], &tm) == OK) {
|
||||||
|
rettv->vval.v_float = ((float_T)tm) / 1000000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "soundfold({word})" function
|
* "soundfold({word})" function
|
||||||
*/
|
*/
|
||||||
|
@@ -393,7 +393,7 @@ static int included_patches[] = {
|
|||||||
// 1288 NA
|
// 1288 NA
|
||||||
// 1287 NA
|
// 1287 NA
|
||||||
// 1286 NA
|
// 1286 NA
|
||||||
// 1285,
|
1285,
|
||||||
1284,
|
1284,
|
||||||
// 1283 NA
|
// 1283 NA
|
||||||
1282,
|
1282,
|
||||||
|
Reference in New Issue
Block a user