I was trying out python -mtimeitso I put python -mtimeit \"n = 0; while n < 10: pass\" Then an invalid syntax error showed up. same with semicol
python -mtimeit
python -mtimeit \"n = 0; while n < 10: pass\"
timeit can take two parameters: the setup code and the code to time.
timeit
python -mtimeit "n = 0" "while n < 10: pass"
Also, you should change that pass to n += 1 or you'll be in an infinite loop.
pass
n += 1