Skip to content

Instantly share code, notes, and snippets.

@eam
Created December 7, 2015 22:20
Show Gist options
  • Select an option

  • Save eam/db9b3e7cd3b42743455b to your computer and use it in GitHub Desktop.

Select an option

Save eam/db9b3e7cd3b42743455b to your computer and use it in GitHub Desktop.
buf = File.read File.join rom_base_path, bin_filename # 55M file
pos = 0
size = 4096
loop {
chunk = buf.slice(pos, size)
puts "#{Time.now.to_f}: read chunk size: #{chunk.length}"
break if chunk.length != size
pos += size
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment