A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sindresorhus/p-time below:

sindresorhus/p-time: Measure the time a promise takes to resolve

Measure the time a promise takes to resolve

import pTime from 'p-time';
import {execa} from 'execa';

const promise = pTime(execa)('sleep', ['1']);

await promise;
console.log(promise.time);
//=> 1016

Returns a decorated version of asyncFunction that when called returns a Promise with a time property of the elapsed time in milliseconds.

Returns a decorated version of asyncFunction that when called logs the elapsed time in milliseconds of the Promise.

Type: Function

Promise-returning/async function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4