Bird
0
0

You want to measure CPU idle time using the idle hook. Which approach is correct?

hard📝 Application Q9 of 15
FreeRTOS - Task Scheduling

You want to measure CPU idle time using the idle hook. Which approach is correct?

AIncrement a counter in the idle hook and calculate percentage over time
BCall vTaskDelay inside idle hook to measure idle time
CUse a high priority task to count idle cycles
DDisable the idle task and measure CPU usage manually
Step-by-Step Solution
Solution:
  1. Step 1: Understand idle time measurement

    Counting how often the idle hook runs reflects CPU idle time.
  2. Step 2: Analyze options

    Incrementing a counter in idle hook and calculating percentage is correct. Other options misuse delay or task priorities.
  3. Final Answer:

    Increment a counter in the idle hook and calculate percentage over time -> Option A
  4. Quick Check:

    Counting idle hook calls measures idle time = D [OK]
Quick Trick: Count idle hook calls to estimate CPU idle time [OK]
Common Mistakes:
  • Calling delay inside idle hook
  • Using high priority tasks for idle measurement
  • Disabling idle task incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes