You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really enjoying your course on FE Masters. As an fyi, the getEntriesByName method does not exist in version 10 of node. GH issue here.
I was not able to get things working with this new object, but was able to force a work around by using node 9.8.0. Everything appears to work so far on that version of node.
The text was updated successfully, but these errors were encountered:
I am experiencing this as well. Using the docs here, I was able to get it working in Node 10.6.0 like so. (The only actual changes are the import, and then the last 7 lines.)
@stevekinney I can submit a PR if that would help.
const { performance, PerformanceObserver } = require('perf_hooks');
// SETUP 🏁
let iterations = 1e7;
const a = 1;
const b = 2;
const add = (x, y) => x + y;
// 🔚 SETUP
performance.mark('start');
// EXERCISE 💪
while (iterations--) {
add(a, b);
}
// 🔚 EXERCISE
performance.mark('end');
const obs = new PerformanceObserver((list, observer) => {
console.log(list.getEntries()[0]);
performance.clearMarks();
observer.disconnect();
});
obs.observe({ entryTypes: ['measure'] });
performance.measure('My Special Benchmark', 'start', 'end');
Hey @stevekinney,
Really enjoying your course on FE Masters. As an fyi, the getEntriesByName method does not exist in version 10 of node. GH issue here.
I was not able to get things working with this new object, but was able to force a work around by using node 9.8.0. Everything appears to work so far on that version of node.
The text was updated successfully, but these errors were encountered: