Home > @imqueue/core > profile

profile() function

Implements '@profile' decorator.

Signature:

export declare function profile(options?: ProfileDecoratorOptions): any;

Parameters

Parameter

Type

Description

options

ProfileDecoratorOptions

(Optional)

Returns:

any

{( target: any, methodName: (string), descriptor: TypedPropertyDescriptor<(...args: any[]) => any>, ) => void}

Example

~~~typescript import { profile } from '@imqueue/core';

class MyClass {

@profile(true) // forced profiling public myMethod() { // ... }

@profile() // profiling happens only depending on env DEBUG flag private innerMethod() { // ... } } ~~~