ts-timed
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

ts-timed

Typescript decorators for timing async and synchronous functions

Example Usage

class Bar {
     @timedAsync((className, funcName, duration) => {console.log(className, funcName, duration); return Promise.resolve()})
     public static async foo() {
         let result = await new Promise((res, rej) => setTimeout(() => res("this is a test"), 1000));
         console.log(result);
         return result;
     }
 }

 Bar.foo().then(r => console.log(r));

Package Sidebar

Install

npm i ts-timed

Weekly Downloads

4

Version

1.2.2

License

MIT

Unpacked Size

9.49 kB

Total Files

5

Last publish

Collaborators

  • swahvay
  • stridesoftware
  • amyatstride
  • scottbessler
  • mschoendorf
  • djres88
  • dangsd
  • matt.naides
  • tylergetstride
  • savbaron
  • mhiggs
  • maxiappleton
  • chrischang127