Bird
0
0

Which of the following is the correct way to calculate latency in Python for a step using time module?

easy📝 Syntax Q3 of 15
Agentic AI - Agent Observability
Which of the following is the correct way to calculate latency in Python for a step using time module?
Alatency = start_time + end_time
Blatency = end_time - start_time
Clatency = start_time * end_time
Dlatency = end_time / start_time
Step-by-Step Solution
Solution:
  1. Step 1: Recall latency formula

    Latency is the difference between end and start times.
  2. Step 2: Match formula to options

    Subtracting start_time from end_time gives duration.
  3. Final Answer:

    latency = end_time - start_time -> Option B
  4. Quick Check:

    Latency calculation = end_time minus start_time [OK]
Quick Trick: Latency = end time minus start time [OK]
Common Mistakes:
  • Adding times instead of subtracting
  • Multiplying or dividing times incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes