Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
test
.rspec
Algoritm Complexity Comparison.xlsx
README.md
timer.rb

README.md

Timer for ruby code

To use this class, require it into your project, then create a new object of this class.

To get the duration your code took to run, just pass your code as a yield into your new object's duration method.

****************

ex: you want to measure the duration of iterating from 0 to 1000000

timer = Timer.new

iteration_timer = timer.duration { 

    i = 0

    while i < 1000000

        i += 1

    end

}

Now iteration_timer = some seconds

You can’t perform that action at this time.