"Ruby Performance Measure"

Also available as a gist. Very simple way of measuring execution time in seconds using Ruby

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/usr/bin/env ruby
# Measure performance in seconds of tasks
# Record Startime For performance measurements
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."

Matlab has a slightly simpler function for this

tic
%Main part goes here
toc

social