Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread mosscliffe
Many thanks. I think I see what you mean. I will try 'timeit' as well. Aren't examples wonderful ? On 10 May, 11:42, Ant <[EMAIL PROTECTED]> wrote: > As Stephan said, you can investigate the timeit module. If you want to > test it your way, wrap up your function call in another function: > > On

Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread Ant
As Stephan said, you can investigate the timeit module. If you want to test it your way, wrap up your function call in another function: On May 10, 9:27 am, mosscliffe <[EMAIL PROTECTED]> wrote: ... > def timeloop(dofunction,iters=10): ... > > def lookup(recs,patterns): ... > myrecs = ... > def t

Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread Steffen Oschatz
On 10 Mai, 10:27, mosscliffe <[EMAIL PROTECTED]> wrote: > I am trying to time a function's execution, Do you know the timeit module ? : Tool for measuring execution time of small code snippets Steffen -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread Asun Friere
Try again ... Just looking over your code quickly ... the function 'lookup' returns either True or False (a boolean) depending on whether matchcount == pattcount. Then in the declaration of the function 'timeloop' this return value gets bound to 'dofunction.' The subsequent call 'dofunction()' f