How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
|   | 1 |  initial version  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
|   | 2 |  No.2 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.it.
If possible, I would prefer not to redirect streams or redefine print, etc.
|   | 3 |  No.3 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
it.
If possible, I would prefer not to redirect streams or redefine print, etc.
|   | 4 |  No.4 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
If possible, I would prefer not to redirect streams or redefine print, etc.
EDIT: got it, leaving the question for reference. timeit("blah",seconds=True) returns a number. This should probably get a mention in 'timeit?'.
|   | 5 |  No.5 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
If possible, I would prefer not to redirect streams or redefine print, etc.
EDIT: got it, leaving the question for reference.
reference.
timeit("blah",seconds=True) returns a number.
number.
This should probably get a mention in 'timeit?'.
|   | 6 |  No.6 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
If possible, I would prefer not to redirect streams or redefine print, etc.
EDIT: got it, leaving the question for reference.
timeit("blah",seconds=True) returns a number.
This should probably get a mention in 'timeit?'.
|   | 7 |  No.7 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
If possible, I would prefer not to redirect streams or redefine print, etc.
EDIT: got it, leaving the question for reference.
timeit("blah",seconds=True) returns a number.
This should probably get a mention in 'timeit?'.
|   | 8 |  Please please stop messing up new lines. One shouldn't have to use br.  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
If possible, I would prefer not to redirect streams or redefine print, etc.
EDIT: got it, leaving the question for reference.
timeit("blah",seconds=True) returns a number.
This should probably get a mention in 'timeit?'.
|   | 9 |  No.9 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
If possible, I would prefer not to redirect streams or redefine print, etc.
EDIT: got it, leaving the question for reference.
This should probably get a mention in 'timeit?'.
|   | 10 |  No.10 Revision  | 
How can I record in a variable the amount of time taken by a function? I read somewhere that timeit is the good way to time stuff, but it seems to print its output instead of returning it.
If possible, I would prefer not to redirect streams or redefine print, etc.
EDIT: got it, leaving the question for reference.
timeit("blah",seconds=True) timeit("blah",seconds=True)
returns a number.
number.
This should probably get a mention in 'timeit?'.
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.