Try:

---
import time
start_time = time.time()
 
<code here>
 
run_time = time.time() - start_time
print 'Run time: %f seconds' % run_time
---

Also have a look at the timeit module for more timing functionality.

- Adam
 


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Robert Rawlins - Think Blue
        Sent: Tuesday, July 10, 2007 11:40 AM
        To: python-list@python.org
        Subject: Time A Script
        
        

        Hello Guys,

         

        What's the best way to time how long it takes a script to run,
from top to bottom and then have it print that execution time at the
end?

         

        Thanks guys,

         

        Rob

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to