File.ReadLines
was introduced in .NET 4.0
var count = File.ReadLines(file).Count();
works in 4 seconds, the same time as the first code snippet
File.ReadLines
was introduced in .NET 4.0
var count = File.ReadLines(file).Count();
works in 4 seconds, the same time as the first code snippet