Rearrange the lines below to measure the performance of myOperation function.
Intro to performance hooks
Operation duration
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
import { performance } from 'perf_hooks';
myOperation();
const entries = performance.getEntriesByName('My Operation');
performance.mark('end');
console.log(entries[0].duration);
performance.mark('start');
performance.measure('My Operation', 'start', 'end');
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.