title: How to round up timedelta by seconds?
body: <p>I am trying to get time measurement of my script in format <code>HH:MM:SS</code>. <code>datetime.timedelta</code> does not have a <code>strftime</code> function. I want to get rid of the microsecond indication. <code>duration</code> is a <code>timedelta</code> object.</p>
  
  <pre><code>import datetime
  
  start = datetime.datetime.now()
  
  for i in range(100000000):
      pass
  
  end = datetime.datetime.now()
  
  duration = end - start
  
  print(duration)
  </code></pre>
  
  <p>Output:</p>
  
  <pre class="lang-none prettyprint-override"><code>0:00:03.474106
  </code></pre>
  
  <p>But I need:</p>
  
  <pre class="lang-none prettyprint-override"><code>0:00:04
  </code></pre>