diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2016-04-16 20:45:09 +0200 |
---|---|---|
committer | KillTheMule <KillTheMule@users.noreply.github.com> | 2016-05-08 20:15:07 +0200 |
commit | 219a8bdb3600bc2075cd6b84e64813874b4ed290 (patch) | |
tree | 90633d608a96fe6b0fb538b314ccad7f90c3409e | |
parent | 65b74998723867c03683de8c6b71b5a71b5a7c59 (diff) | |
download | rneovim-219a8bdb3600bc2075cd6b84e64813874b4ed290.tar.gz rneovim-219a8bdb3600bc2075cd6b84e64813874b4ed290.tar.bz2 rneovim-219a8bdb3600bc2075cd6b84e64813874b4ed290.zip |
Add documentation for reltimefloat()
from https://github.com/vim/vim/commit/03413f44167c4b5cd0012def9bb331e2518c83cf
Also adjust the entries for reltime() and reltimestr().
-rw-r--r-- | runtime/doc/eval.txt | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 99b8760402..1990cf735d 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2009,6 +2009,7 @@ range( {expr} [, {max} [, {stride}]]) readfile( {fname} [, {binary} [, {max}]]) List get list of lines from file {fname} reltime( [{start} [, {end}]]) List get time value +reltimefloat( {time}) Float turn the time value into a Float reltimestr( {time}) String turn time value into a String remote_expr( {server}, {string} [, {idvar}]) String send expression @@ -5319,7 +5320,8 @@ readfile({fname} [, {binary} [, {max}]]) reltime([{start} [, {end}]]) *reltime()* Return an item that represents a time value. The format of the item depends on the system. It can be passed to - |reltimestr()| to convert it to a string. + |reltimestr()| to convert it to a string or |reltimefloat()| + to convert to a float. Without an argument it returns the current time. With one argument is returns the time passed since the time specified in the argument. @@ -5327,7 +5329,16 @@ reltime([{start} [, {end}]]) *reltime()* and {end}. The {start} and {end} arguments must be values returned by reltime(). - {only available when compiled with the |+reltime| feature} + +reltimefloat({time}) *reltimefloat()* + Return a Float that represents the time value of {time}. + Unit of time is seconds. + Example: + let start = reltime() + call MyFunction() + let seconds = reltimefloat(reltime(start)) + See the note of reltimestr() about overhead. + Also see |profiling|. reltimestr({time}) *reltimestr()* Return a String that represents the time value of {time}. @@ -5337,12 +5348,10 @@ reltimestr({time}) *reltimestr()* call MyFunction() echo reltimestr(reltime(start)) < Note that overhead for the commands will be added to the time. - The accuracy depends on the system. Leading spaces are used to make the string align nicely. You can use split() to remove it. > echo split(reltimestr(reltime(start)))[0] < Also see |profiling|. - {only available when compiled with the |+reltime| feature} *remote_expr()* *E449* remote_expr({server}, {string} [, {idvar}]) |