Date: Fri, 27 Jan 2012 17:35:39 -0800
Subject: Re: [Tutor] compile time calculator
From: [email protected]
To: [email protected]
CC: [email protected]

On Fri, Jan 27, 2012 at 7:46 AM, Surya K <[email protected]> wrote:





Hi,
I want to calculate compile time for my puzzles. 
Since nobody else has mentioned it yet...
http://xkcd.com/303/


Well, using python documentation, I did this..
(calculating execution time).
def main():## This is my whole puzzle code...

    fobj_ip = open('D:/code/py/input.txt', 'r')    fobj_op = 
open('D:/code/py/output.txt','w')
    line=1    for eachLine in fobj_ip:        if line>1:            
fobj_op.write ("Case #%d: %d\n" %(line-1, the_count(eachLine) ) )        line+=1
    pass
if __name__ == '__main__':    from timeit import Timer    main()    t = 
Timer("main()")    print t.timeit()

This is showing the following output
10000000 loops, best of 3: 0.0612 usec per loop
(This is repeating...)
So, what exactly is 0.0612 usec per loop, is that execution time of my whole 
program??If, how do I calculate it in seconds.

                                          
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to