Bird
0
0

Which code snippet correctly measures latency for a step using start and end time calls?

easy📝 Syntax Q12 of 15
Agentic AI - Agent Observability
Which code snippet correctly measures latency for a step using start and end time calls?
Astart_time = get_time() // step code end_time = get_time() latency = end_time - start_time
Bstart_time = get_time() latency = start_time end_time = get_time()
Clatency = get_time() // step code latency = latency - get_time()
Dend_time = get_time() // step code start_time = get_time() latency = end_time - start_time
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct order of time calls

    Start time must be recorded before the step, end time after the step.
  2. Step 2: Calculate latency as difference

    Latency is end_time minus start_time to get duration.
  3. Final Answer:

    start_time = get_time()\n// step code\nend_time = get_time()\nlatency = end_time - start_time -> Option A
  4. Quick Check:

    Latency = end - start [OK]
Quick Trick: Latency = end time minus start time [OK]
Common Mistakes:
  • Subtracting start from end incorrectly
  • Assigning latency before step runs
  • Swapping start and end times

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes