demisjohn / pyFIMM

Python Interface to PhotonDesign's FimmWave/FimmProp software.
15 stars 4 forks source link

***.Calc(): display calculation time #81

Open demisjohn opened 8 years ago

demisjohn commented 8 years ago

Display time ***.calc() took? eg. Device.calc(), Cavity.calc(), WG.calc() etc.

The code to do this is as follows (python 2.5):

import time, date time
start = time.time() # get current time

### runCalc_function()

# print elapsed solving time:
print(  "Calc() took (h:m:s.us) :" + str(datetime.timedelta(seconds=time.time()-start))   )