Skip to content

hastalavistababy/log-execution-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Log method execution time decorator

Log method execution time decorator using Nodejs performance hook

Install

npm install log-execution-time --save-dev

Example

import {LogExecutionTime} from 'log-execution-time';

class Person {
    public age = 10

    @LogExecutionTime
    isAdult() {
        return this.age > 18
    }
}

let person = new Person();
person.isAdult();

// function isAdult(): 0.0001s

Dependency

please set experimentalDecorators and allowSyntheticDefaultImports true in tsconfig.json 

About

Log execution time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published