diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2016-04-16 17:15:51 +0200 |
---|---|---|
committer | KillTheMule <KillTheMule@users.noreply.github.com> | 2016-05-08 20:15:07 +0200 |
commit | dc913974638af5ba4b0d76bcb3b0efd838bf30a1 (patch) | |
tree | af160d8fa29ce7707493758dc174bd69bdb54aca /src | |
parent | b02ba11cb156e094d3f6f12fc7c79a983b6df68d (diff) | |
download | rneovim-dc913974638af5ba4b0d76bcb3b0efd838bf30a1.tar.gz rneovim-dc913974638af5ba4b0d76bcb3b0efd838bf30a1.tar.bz2 rneovim-dc913974638af5ba4b0d76bcb3b0efd838bf30a1.zip |
vim-patch:7.4.1285
Problem: Cannot measure elapsed time.
Solution: Add reltimefloat().
https://github.com/vim/vim/commit/79c2c881bb7ae1cbdeeff91d4875b4bf2e54df06
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 16 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d84bdfebfe..16a96ba29e 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6850,6 +6850,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 }, { "remove", 2, 3, f_remove }, { "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); } +// +// "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 */ diff --git a/src/nvim/version.c b/src/nvim/version.c index 637b3778a7..e0bd83434c 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -393,7 +393,7 @@ static int included_patches[] = { // 1288 NA // 1287 NA // 1286 NA - // 1285, + 1285, 1284, // 1283 NA 1282, |