[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FEMM] How to get computation time with lua script



Tsarafidy RAMINOSOA wrote:

Hello All,
Could anyone tell me how to get the computation duration using lua script?
Thanks in advance.
Tsarafidy

The clock() command returns an approximation of the amount of CPU time used by the program, in seconds. You could call clock at the beginning of the a script to get the starting time, call it again at the end to get the finish time, and take the difference to see how long it all took. An example that would measure how long an analysis takes to run in femm 3.3 would be:


t1=clock()
analyze()
t2=clock()
print(t2-t1)

Dave.
--
David Meeker
email: dmeeker@xxxxxxxx
www: http://femm.berlios.de/dmeeker