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

x/ddc_vim/deps.ts>fn.reltime

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

Return an item that represents a time value. The item is a list with items that depend on the system. In Vim 9 script the type list can be used. The item can be passed to reltimestr() to convert it to a string or reltimefloat() to convert to a Float. For example, to see the time spent in function Work():

var startTime = reltime()
Work()
echo startTime->reltime()->reltimestr()

Without an argument reltime() returns the current time (the representation is system-dependent, it can not be used as the wall-clock time, see localtime() for that). With one argument is returns the time passed since the time specified in the argument. With two arguments it returns the time passed between {start} and {end}.

The {start} and {end} arguments must be values returned by reltime(). If there is an error an empty List is returned in legacy script, in Vim9 script an error is given.

Can also be used as a method:

GetStart()->reltime()

only available when compiled with the +reltime feature

Parameters

denops: Denops
start: unknown
end: unknown

Returns

Promise<unknown[]>