Bird
0
0

Which Node.js flag enables CPU profiling when running your script?

easy📝 Conceptual Q2 of 15
Node.js - Debugging and Profiling
Which Node.js flag enables CPU profiling when running your script?
A--prof
B--inspect
C--trace-warnings
D--experimental-modules
Step-by-Step Solution
Solution:
  1. Step 1: Identify profiling flag

    The flag '--prof' enables CPU profiling in Node.js.
  2. Step 2: Exclude unrelated flags

    '--inspect' is for debugging, '--trace-warnings' for warnings, and '--experimental-modules' for module support.
  3. Final Answer:

    --prof -> Option A
  4. Quick Check:

    CPU profiling flag = --prof [OK]
Quick Trick: Use --prof flag to start CPU profiling in Node.js [OK]
Common Mistakes:
  • Using --inspect instead of --prof for profiling
  • Confusing profiling with debugging flags
  • Trying to profile without any flags

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes