Created
April 27, 2009 09:50
-
-
Save joho/102417 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST_INPUT_PATH = '/Users/joho/Desktop/Grand Designs S09E10.avi' | |
TIMES_TO_TEST = 10 | |
start = Time.now | |
TIMES_TO_TEST.times do | |
puts "start" | |
File.open 'test.avi', 'w' do |out_file| | |
File.open TEST_INPUT_PATH, 'r' do |in_file| | |
out_file.write in_file.read | |
end | |
end | |
`rm test.avi` | |
end | |
puts Time.now - start | |
start = Time.now | |
TIMES_TO_TEST.times do | |
puts "start 2" | |
File.open 'test2.avi', 'w' do |out_file| | |
File.open TEST_INPUT_PATH, 'r' do |in_file| | |
while out_file.syswrite((in_file.sysread(16_384) rescue nil) > 0 | |
end | |
end | |
end | |
`rm test2.avi` | |
end | |
puts Time.now - start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment