title: How to print the execution time of the computation done in a tensorflow code?
body: <p>This is a generic question. </p>
  
  <p>I wrote a piece of code that uses tensorflow to do the computation.</p>
  
  <p>I want to print the time consumed during the execution of the code. </p>
  
  <p>First I used: </p>
  
  <pre><code>import time
  start = time.time()
  main()
  print ("%s"  % (time.time() - start_time))
  </code></pre>
  
  <p>But I read that this is an inaccurate way to measure the execution time. </p>
  
  <p>How to accurately measure the execution time of my program. </p>