profile() function
Implements '@profile' decorator.
Signature:
export declare function profile(options?: ProfileDecoratorOptions): (target: any, methodName: string, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
options |
(Optional) |
Returns:
(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 happened only depending on env DEBUG flag private innerMethod() { // ... } } ~~~
{( target: any, methodName: (string), descriptor: TypedPropertyDescriptor<(...args: any[]) => any> ) => void}