hr-exectime

1.0.1 • Public • Published

hr-exectime

HRExecTime, is a small module that allows to simply return the execution time of an operation in human format, i.e. "years (you never know :-), days, hours, minutes, seconds and milliseconds". To use it, just add the module to your file, const HRExT = require("hr-exectime") or import HRExT from '"hr-exectime" or import * as HRExT from "hr-exectime" in Ts , define the start point instantiate the class and use the finish() method to return the end point.

example:

const time = new HRExT();
   ...do something
console.log(time.finish());

"Performed in 6 seconds and 36 ms"

you can replace the Performed in sentence with whatever you want by adding a string to the initialization e.g.

const time = new HRExT("my sentence");

ISC License (ISC)

Copyright 2022 Julien A.U. Bardin

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Package Sidebar

Install

npm i hr-exectime

Weekly Downloads

64

Version

1.0.1

License

ISC

Unpacked Size

4.47 kB

Total Files

4

Last publish

Collaborators

  • slade850