Hi,
I want to measure some times.

My code:

def ff():
    return 2*3

def tm():
    import timeit
    t1 = timeit.Timer(stmt='a=2*3').timeit(number=100)/100
    t2 = timeit.Timer(stmt='a=ff()',setup='from __main__ import
ff').timeit(number=100)/100
    return dict(t1=t1, t2=t2)

t1 is ok, but t2 gives an error: ImportError: cannot import name ff
I understand, that __main__ is not a good idea, but what would be the
correct name?

Regards, Martin

Reply via email to