Class: Rubyboy::Bench
- Inherits:
-
Object
- Object
- Rubyboy::Bench
- Defined in:
- lib/bench.rb
Instance Method Summary collapse
Instance Method Details
#bench(count: 3, frames: 1500, rom_path: 'lib/roms/tobu.gb') ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bench.rb', line 14 def bench(count: 3, frames: 1500, rom_path: 'lib/roms/tobu.gb') time_sum = 0 count.times do |i| time = Rubyboy::Emulator.new(rom_path).bench(frames) time_sum += time puts "#{i + 1}: #{time / 1_000_000_000.0} sec" end puts "FPS: #{frames * count * 1_000_000_000.0 / time_sum}" end |