Measures how long a function takes, logging it if a logger is given.
const { result, duration } = await withTiming('fetchData', () => fetchData(url)); Copy
const { result, duration } = await withTiming('fetchData', () => fetchData(url));
Measures how long a function takes, logging it if a logger is given.