monochromegane/the_platinum_searcher — pull request #28 by shantanugoel (2014-05-06 18:17:07+00:00)
Title: Add --stats option to display some stats about the search

ag has an option to display some stats which I think is pretty useful. This pull request adds the support for the same.
Out put seems something like this at the bottom of search output if "--stats" option is given.
35 Files Searched
16 Files Matched
32 Total Text Matches
15.914117ms Elapsed

Some of the stats are collected without giving the option as well but not displayed if option is not given. This is because collecting them (just incrementing a variable) unconditionally is faster/better than spending a conditional branch on it. Also, they don't affect the time much.