Skip to content

Instantly share code, notes, and snippets.

@msassak
Created August 19, 2009 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msassak/170476 to your computer and use it in GitHub Desktop.
Save msassak/170476 to your computer and use it in GitHub Desktop.
start = Time.now
puts "Starting to read file ..."
num = 0
File.open(ARGV[0]) do |f|
f.each { |l| num += l.split.length }
end
puts "The number of tokens is: #{num}."
puts "It took #{(Time.now - start) * 1000} ms"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment