title: Time measure script in python
body: <p>I received the following script from a fellow programmer: </p>
  
  <pre><code>    from time import *
      start = strptime(asctime())
      end = strptime(asctime())
      print 'you took %i minutes' % (end[4] - start[4])
  </code></pre>
  
  <p>As you might already know, the script measures the time between the third and fourth line. However, it seems to measure it in minutes. How can I go about to measure it in seconds, with at least one decimal place (ex. 7.4 seconds).</p>
  
  <p>Also, I would like to add one extra piece of functionality. Say the script runs, and I am asked by the program to type any word. At the end of my typing, I have to press the enter key to exit the program and measure the time from the first keystroke to the moment I press enter. How can I go about measuring this? </p>