I want to compare the execution time for mathematical equations for different dynamic, interpreted programming languages like Ruby, Perl, and Python.
In Python, there is the convenient
timeit module, which allows me to time, where I can simply time for, e.g., a least squares fit (
'from __main__ import python_lstsqr, x, y')\
(here the best of 3 repetitions and 1000 loops per repetition)
Are there equivalents in Perl and Ruby?
For Perl, you can use built-in
For Ruby, the built-in
benchmark is good enough.