Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.reltimestr

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.reltimestr
import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { reltimestr } = fn;

Return a String that represents the time value of {time}. This is the number of seconds, a dot and the number of microseconds. Example:

let start = reltime()
call MyFunction()
echo reltimestr(reltime(start))

Note that overhead for the commands will be added to the time. The accuracy depends on the system. Use reltimefloat() for the greatest accuracy which is nanoseconds on some systems. 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. If there is an error an empty string is returned in legacy script, in Vim9 script an error is given.

Can also be used as a method:

reltime(start)->reltimestr()

only available when compiled with the +reltime feature

Parameters

denops: Denops
time: unknown

Returns

Promise<string>