I'm new to Python, and confused by the date/time documentation. I want to compute the time that it takes to perform a computation.
In java, I would write:
long timeBefore = System.currentTimeMillis();
doStuff();
long timeAfter = System.currentTimeMillis();
elapsed time = timeAfter - timeBefore;
I'm sure it's even easier in Python. Can anyone help?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…