Sha256: c26196e29a20f38e89e09827af09176ab7da545a87a4e5f4de37219fb7c5ce70

Contents?: true

Size: 971 Bytes

Versions: 64

Compression:

Stored size: 971 Bytes

Contents

# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013  Kouhei Sutou <kou@clear-code.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

module Grntest
  class BaseResult
    attr_accessor :elapsed_time
    def initialize
      @elapsed_time = 0
    end

    def measure
      start_time = Time.now
      yield
    ensure
      @elapsed_time = Time.now - start_time
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
grntest-1.6.6 lib/grntest/base-result.rb
grntest-1.6.5 lib/grntest/base-result.rb
grntest-1.6.4 lib/grntest/base-result.rb
grntest-1.6.3 lib/grntest/base-result.rb
grntest-1.6.2 lib/grntest/base-result.rb
grntest-1.6.1 lib/grntest/base-result.rb
grntest-1.6.0 lib/grntest/base-result.rb
grntest-1.5.9 lib/grntest/base-result.rb
grntest-1.5.8 lib/grntest/base-result.rb
grntest-1.5.7 lib/grntest/base-result.rb
grntest-1.5.6 lib/grntest/base-result.rb
grntest-1.5.5 lib/grntest/base-result.rb
grntest-1.5.4 lib/grntest/base-result.rb
grntest-1.5.3 lib/grntest/base-result.rb
grntest-1.5.2 lib/grntest/base-result.rb
grntest-1.5.1 lib/grntest/base-result.rb
grntest-1.5.0 lib/grntest/base-result.rb
grntest-1.4.9 lib/grntest/base-result.rb
grntest-1.4.8 lib/grntest/base-result.rb
grntest-1.4.7 lib/grntest/base-result.rb