def timeit(timer=None):
if timer is None:<EOL><INDENT>return time.time()<EOL><DEDENT>else:<EOL><INDENT>took=time.time()-timer<EOL>if took<<NUM_LIT:1>:<EOL><INDENT>return "<STR_LIT>"%(took*<NUM_LIT>)<EOL><DEDENT>elif took<<NUM_LIT>:<EOL><INDENT>return "<STR_LIT>"%(took)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>"%(took/<NUM_LIT>)<EOL><DEDENT><DEDENT>
simple timer. returns a time object, or a string.