promise.ms

1.0.0 • Public • Published

Promise ms

⌚ A light-weight package for timing promises


Usage

$ npm install promise.ms
<script src="https://unpkg.com/promise.ms"></script> <!-- Client Side -->

After installing, import promise.ms (nodejs only)

require("promise.ms");

You can use the prototype ms on any promise to get the amount of milliseconds a promise took to resolve

promise.ms((ms) => {
  console.log("time:", ms);
});

// or

(async () => {
  const ms = await promise.ms();
  console.log("time:", ms);
})();

Readme

Keywords

Package Sidebar

Install

npm i promise.ms

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

1.2 kB

Total Files

3

Last publish

Collaborators

  • ephf