Method: WindowBlessing::WindowedScreen#time
- Defined in:
- lib/window_blessing/windowed_screen.rb
#time(category, info) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/window_blessing/windowed_screen.rb', line 6 def time(category,info) start = Time.now yield stop = Time.now @total_time ||= 0 @draw_count ||= 0 @draw_count += 1 @total_time += stop - start XtermLog.log "#{category} time = #{((@total_time/@draw_count)*1000).to_i}ms #{info}" end |