Problem
Implement measureFunctionPerformance(fn, iterations = 1000, label = 'Function', callback = null) that runs fn iterations times (awaiting if it returns a promise) and reports the average time via the callback.
Asked at Atlassian
JavaScript interview practice: Measure average execution time of a sync or async function over N iterations.
Implement measureFunctionPerformance(fn, iterations = 1000, label = 'Function', callback = null) that runs fn iterations times (awaiting if it returns a promise) and reports the average time via the callback.
Unlock the in-browser editor, test cases, and model solution with Mentoxis Premium.
Unlock with Premium