This file contains hidden or 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
| r1.9.3 ~/workarea/take_a_bm $ ruby take_a_bm.rb | |
| Thread.current.object_id:70331712734240 0.000000 0.000000 0.000000 ( 1.001500) | |
| Thread.current.object_id:70331712733480 0.000000 0.000000 0.000000 ( 1.001537) | |
| Thread.current.object_id:70331712733240 0.000000 0.000000 0.000000 ( 1.001746) | |
| Thread.current.object_id:70331712732600 0.000000 0.000000 0.000000 ( 1.001865) | |
| Thread.current.object_id:70331712731560 0.000000 0.000000 0.000000 ( 1.002109) | |
| Thread.current.object_id:70331712733660 0.000000 0.000000 0.000000 ( 1.000823) | |
| Thread.current.object_id:70331712733400 0.000000 0.000000 0.000000 ( 1.002661) | |
| Thread.current.object_id:70331712733000 0.000000 0.000000 0.000000 ( 1.002736) | |
| Thread.current.object_id:70331712729480 0.000000 0.000000 0.000000 ( 1.002143) |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'digest/md5' | |
| # argument processing -- goes through Dir[], so can use '**/*' etc. | |
| ARGV[0] ||= '.' | |
| # build list of filenames, rejecting symlink, dirs & 0 len files | |
| filenames = ARGV.collect{ |dir| Dir[File.directory?(dir) ? "#{dir}/*" : dir] }.flatten | |
| filenames.reject!{ |fn| File.symlink?(fn) || File.directory?(fn) || File.size?(fn).nil? } |