class GitLab::Exporter::TimeTracker

Time tracking object

Provides a simple time tracking, and returns back the result plus the tracked time wraped in a TrackedResult struct

Public Instance Methods

track() { || ... } click to toggle source
# File lib/gitlab_exporter/util.rb, line 17
def track
  @start = Time.now.to_f
  result = yield
  TrackedResult.new(result, Time.now.to_f - @start)
end