9.0 Released! → Native ESM runtimes 🚀, Vite support ⚡️, multi-window apps and more...
Read Announcement

Call Signature

ts
function profile(name?: string): MethodDecorator;

Defined in: profiling/index.d.ts:98

Method decorator factory. It will intercept the method call and start and pause a timer before and after the method call. Works only if profiling is enabled.

Parameters

ParameterTypeDescription
name?stringName of the timer which will be used for method calls. If not provided - the name of the method will be used.

Returns

MethodDecorator

Call Signature

ts
function profile<F>(fn: F): F;

Defined in: profiling/index.d.ts:105

Function factory. It will intercept the function call and start and pause a timer before and after the function call. Works only if profiling is enabled. Works only if profiling is enabled.

Type Parameters

Type Parameter
F extends Function

Parameters

ParameterTypeDescription
fnFThe function to wrap. Uses the function name to track the times.

Returns

F

Call Signature

ts
function profile<F>(name: string, fn: F): F;

Defined in: profiling/index.d.ts:112

Function factory. It will intercept the function call and start and pause a timer before and after the function call. Works only if profiling is enabled.

Type Parameters

Type Parameter
F extends Function

Parameters

ParameterTypeDescription
namestringThe name used to track calls and times.
fnFThe function to wrap.

Returns

F

Call Signature

ts
function profile<T>(
   target: Object, 
   propertyKey: string | symbol, 
descriptor: TypedPropertyDescriptor<T>): void | TypedPropertyDescriptor<T>;

Defined in: profiling/index.d.ts:117

Method decorator. It will intercept the method calls and start and pause a timer before and after the method call. Works only if profiling is enabled.

Type Parameters

Type Parameter
T

Parameters

ParameterType
targetObject
propertyKeystring | symbol
descriptorTypedPropertyDescriptor<T>

Returns

void | TypedPropertyDescriptor<T>

Call Signature

ts
function profile(): any;

Defined in: profiling/index.d.ts:118

Method decorator factory. It will intercept the method call and start and pause a timer before and after the method call. Works only if profiling is enabled.

Returns

any