Method: Mysql2::Result#each

Defined in:
lib/patches/sql_patches.rb

#each(*args, &blk) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/patches/sql_patches.rb', line 29

def each(*args, &blk)
  return each_without_profiling(*args, &blk) unless @miniprofiler_sql_id

  start = Time.now
  result = each_without_profiling(*args,&blk) 
  elapsed_time = ((Time.now - start).to_f * 1000).round(1)

  @miniprofiler_sql_id.report_reader_duration(elapsed_time) 
  result
end