class Liquid::Profiler::Timing

Attributes

children[R]
code[R]
line_number[R]
partial[R]
render_time[RW]
template_name[R]
total_time[RW]

Public Class Methods

new(code: nil, template_name: nil, line_number: nil) click to toggle source
# File lib/liquid/profiler.rb, line 54
def initialize(code: nil, template_name: nil, line_number: nil)
  @code = code
  @template_name = template_name
  @line_number = line_number
  @children = []
end

Public Instance Methods

self_time() click to toggle source
# File lib/liquid/profiler.rb, line 61
def self_time
  @self_time ||= begin
    total_children_time = 0.0
    @children.each do |child|
      total_children_time += child.total_time
    end
    @total_time - total_children_time
  end
end