[Python-ideas] Timer that starts as soon as it is imported
Oleg Broytman
phd at phdru.name
Tue May 26 21:06:46 CEST 2015
Hi!
On Tue, May 26, 2015 at 09:05:06PM +0300, anatoly techtonik <techtonik at gmail.com> wrote:
> On Fri, May 22, 2015 at 1:58 PM, Oleg Broytman <phd at phdru.name> wrote:
> > On Fri, May 22, 2015 at 12:59:30PM +0300, anatoly techtonik <techtonik at gmail.com> wrote:
> >> Is the idea to have timer that starts on import is good?
> >
> > No, because:
> >
> > -- it could be imported at the wrong time;
>
> Any time is right.
Very much application-dependent. What if you wanna measure import
time?
> > -- it couldn't be "reimported"; what is the usage of one-time timer?
>
> The idea is to have convenient default timer to measure
> script run-time.
Good idea for a small separate project. Bad for the stdlib. Not every
small simple useful module must be in the stdlib.
Oleg.
--
Oleg Broytman http://phdru.name/ phd at phdru.name
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-ideas
mailing list