http://bugs.python.org/issue19495 timeit enhancement

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Jun 12 20:44:23 EDT 2014


On 2014年6月13日 00:35:43 +0100, Mark Lawrence wrote:
> The request is for a class within timeit that allows you to test code
> inside a with block. It strikes me as being useful but there's only one
> response on the issue, albeit a positive one. If others here think this
> would be a useful addition I'll see if I can take this forward, unless
> there are any timeit fans lurking who'd like to run with it themselves.

I have a Stopwatch() context manager which I have been using for a long 
time, very successfully. There's an early version here:
http://code.activestate.com/recipes/577896
I'll clean it up and submit it on the bug tracker.
-- 
Steven D'Aprano
http://import-that.dreamwidth.org/


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /