Measures how long (in milliseconds) the given callback takes to run to completion. By default this is synchronous, but it will automatically switch to async and await the callback if it returns a promise.
import {measureExecutionDuration} from '@augment-vir/common';const duration1 = measureExecutionDuration(() => {});const duration2 = await measureExecutionDuration(async () => {}); Copy
import {measureExecutionDuration} from '@augment-vir/common';const duration1 = measureExecutionDuration(() => {});const duration2 = await measureExecutionDuration(async () => {});
@augment-vir/common
Measures how long (in milliseconds) the given callback takes to run to completion. By default this is synchronous, but it will automatically switch to async and await the callback if it returns a promise.