Sha256: 869b4cdfa8c27d0f70e5465a0817dbe863f47ee40f7fd03d2c0ef835dbb89e6c

Contents?: true

Size: 621 Bytes

Versions: 19

Compression:

Stored size: 621 Bytes

Contents

module ZTK
  class Profiler

    # Profiler Timer Functionality
    class Timer
      require 'ztk/profiler/timer/class_methods'

      extend ZTK::Profiler::Timer::ClassMethods

      attr_accessor :name
      attr_accessor :parent
      attr_accessor :benchmark

      def initialize(name, parent=nil)
        self.name   = name
        self.parent = parent

        self.class.add(self)
      end

      def nested_time
        @nested_time ||= self.class.nested_time(self.name, self)
        @nested_time
      end

      def benchmark_nested
        (self.benchmark - self.nested_time)
      end

    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ztk-3.3.2 lib/ztk/profiler/timer.rb
ztk-3.3.1 lib/ztk/profiler/timer.rb
ztk-3.3.0 lib/ztk/profiler/timer.rb
ztk-3.2.6 lib/ztk/profiler/timer.rb
ztk-3.2.5 lib/ztk/profiler/timer.rb
ztk-3.2.4 lib/ztk/profiler/timer.rb
ztk-3.2.3 lib/ztk/profiler/timer.rb
ztk-3.2.2 lib/ztk/profiler/timer.rb
ztk-3.2.1 lib/ztk/profiler/timer.rb
ztk-3.2.0 lib/ztk/profiler/timer.rb
ztk-3.1.0 lib/ztk/profiler/timer.rb
ztk-3.0.4 lib/ztk/profiler/timer.rb
ztk-3.0.3 lib/ztk/profiler/timer.rb
ztk-3.0.2 lib/ztk/profiler/timer.rb
ztk-3.0.1 lib/ztk/profiler/timer.rb
ztk-3.0.0 lib/ztk/profiler/timer.rb
ztk-2.4.2 lib/ztk/profiler/timer.rb
ztk-2.4.1 lib/ztk/profiler/timer.rb
ztk-2.4.0 lib/ztk/profiler/timer.rb