title: How to get the duration time in Python?
body: <p>See my sample code:</p>
  
  <pre><code>import time
  
  start_time_string = "2013-05-24 17:51:06"
  end_time_string = "2013-05-24 17:59:33"
  
  start_time_stamp = time.mktime(time.strptime(start_time_string, "%Y-%m-%d %H:%M:%S"))
  start_time_struct = time.localtime(start_time_stamp)
  
  end_time_stamp = time.mktime(time.strptime(end_time_string, "%Y-%m-%d %H:%M:%S"))
  end_time_struct = time.localtime(end_time_stamp)
  
  # what's the next step to get duration time, like x minute?
  </code></pre>
  
  <p>I read <a href="https://docs.python.org/2/library/time.html" rel="nofollow">https://docs.python.org/2/library/time.html</a> but don't find a method.</p>
  
  <p>Thank you!</p>
  
  <p>This question is closed, thanks so much to pjz and Robᵩ!</p>
  
  <p>A perfect solution is posted in <a href="http://ideone.com/J8VwNl" rel="nofollow">http://ideone.com/J8VwNl</a></p>