Twitter Updates

Wednesday 19 November 2008

Ruby script performance measure

For measuring runtime performance of ruby scripts insert the few lines below around the part you want to measure.
----
# Record Startime For performance measurments
startTime = Time.now

Main part of script goes here

#Calculate and Display Execution Time in seconds
execTime = Time.now - startTime
puts "Execution time #{execTime} seconds."
----
Thats it!

No comments: