Skip to content

Commit

Permalink
fix: Fix a bug in the rule performance tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Nov 22, 2020
1 parent 6244c80 commit 07e8f36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/timing-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export class TimingTracker {
return data;
}

public track<R, A extends any[] = any[]>(
public async track<R, A extends any[] = any[]>(
id: string,
fn: (...args: A) => R,
fn: (...args: A) => Promise<R>,
...args: A
): R {
): Promise<R> {
const now = performance.now();
const result = fn(...args);
const result = await fn(...args);
const ms = performance.now() - now;
this._data[id] = (this._data[id] ?? 0) + ms;
return result;
Expand Down

0 comments on commit 07e8f36

Please sign in to comment.