c# counting lines
C#
public long CountLinesLINQ(FileInfo file)
=> File.ReadLines(file.FullName).Count();
private void Benchmark(FileInfo file)
{
Console.WriteLine(nameof(CountLinesLINQ));
var sw = Stopwatch.StartNew();
var count = CountLinesLINQ(file);
sw.Stop();
Console.WriteLine("{0} | {1} | Gen0 - {2} | Gen1 - {3} | Gen2 - {4}",
file.Name,
sw.Elapsed.ToString(),
GC.CollectionCount(0).ToString("N0"),
GC.CollectionCount(1).ToString("N0"),
GC.CollectionCount(2).ToString("N0"));
}
Also in C#:
- Title
- for each textbox c#
- Category
- C#
- Title
- how do i foreach c#
- Category
- C#
- Title
- c# string remove special characters
- Category
- C#
- Title
- c# max two values
- Category
- C#
- Title
- c# get object property value by name
- Category
- C#
- Title
- get type of variable c#
- Category
- C#
- Title
- c# print to console
- Category
- C#
- Title
- c# foreach arra
- Category
- C#
- Title
- copy a list C#
- Category
- C#
- Title
- unity mouse click position
- Category
- C#
- Title
- c# abstract class
- Category
- C#
- Title
- c# loop through two dimensional array
- Category
- C#
- Title
- parsing string to int without format exception c#
- Category
- C#
- Title
- how to start an if statement in c#
- Category
- C#
- Title
- C# resize window without title bar
- Category
- C#
- Title
- add mime type for woff in web.config
- Category
- C#
- Title
- C# get all child classes of a class
- Category
- C#
- Title
- c# error "The name 'ViewBag' does not exist in the current context"
- Category
- C#
- Title
- check if network is available c#
- Category
- C#
- Title
- c# class to byte array
- Category
- C#
- Title
- countdown script in unity
- Category
- C#
- Title
- unity add component
- Category
- C#
- Title
- polling data source c# using threads
- Category
- C#
- Title
- c# warning CS0108
- Category
- C#
- Title
- c# switct case
- Category
- C#
- Title
- round vector3 unity
- Category
- C#
- Title
- debug.log
- Category
- C#
- Title
- xamarin hide back button
- Category
- C#
- Title
- how to work with ascii in c#
- Category
- C#
- Title
- c# to vb.net
- Category
- C#
- Title
- Net.ServicePointManager.SecurityProtocol .net framework 4
- Category
- C#
- Title
- cannot apply indexing with to an expression of type 'object'
- Category
- C#
- Title
- unity to integer
- Category
- C#
- Title
- unity pro version free download
- Category
- C#
- Title
- c# list to string
- Category
- C#
- Title
- c# array Reverse method
- Category
- C#
- Title
- c# type of generic is string
- Category
- C#
- Title
- c# array isn't working
- Category
- C#
- Title
- how to add to an array c#
- Category
- C#
- Title
- c# object to json string
- Category
- C#
- Title
- variables
- Category
- C#
- Title
- convert comma separated string to array c#
- Category
- C#
- Title
- C# events
- Category
- C#
- Title
- c# ref
- Category
- C#
- Title
- see if two string arrays are equal c#
- Category
- C#
- Title
- how to destroy a gameobject after some hits in unity 3d
- Category
- C#
- Title
- visual studio clear text script
- Category
- C#
- Title
- c# sql duplicate key exception
- Category
- C#
- Title
- unity detect number key
- Category
- C#
- Title
- c# duplicate object instance
- Category
- C#
- Title
- datetitime contrusctor c#
- Category
- C#
- Title
- c# get desktop path
- Category
- C#
- Title
- c# resize image keep aspect ratio
- Category
- C#
- Title
- unity object array
- Category
- C#
- Title
- Unity C# instantiate prefab
- Category
- C#
- Title
- check if enabled unity
- Category
- C#
- Title
- sqlite connection c#
- Category
- C#
- Title
- windows forms iterate through all controls
- Category
- C#
- Title
- public enum c#
- Category
- C#
- Title
- c# calculate difference between two dates in days
- Category
- C#
- Title
- unity how to make a ui disappear
- Category
- C#
- Title
- C# get pc language
- Category
- C#
- Title
- linq query select top 1 c#
- Category
- C#
- Title
- Failed to retrieve Firebase Instance Id
- Category
- C#
- Title
- c# quick "is" "as"
- Category
- C#
- Title
- math.pow in C# using loop
- Category
- C#
- Title
- external font family uwp c#
- Category
- C#
- Title
- unity try get component
- Category
- C#
- Title
- How to search for a string from readline in c#
- Category
- C#
- Title
- c# how to check if two lists have same values
- Category
- C#
- Title
- csharp attributes as generics constraints
- Category
- C#
- Title
- c# stop loop in method
- Category
- C#
- Title
- first sentence letter capital in c#
- Category
- C#
- Title
- C# aspnet how to run a migration
- Category
- C#
- Title
- unity calculate path
- Category
- C#
- Title
- how to edit a c# list
- Category
- C#
- Title
- c# filter non alphanumeric characters
- Category
- C#
- Title
- how to make a game
- Category
- C#
- Title
- c# global enumerator
- Category
- C#
- Title
- arry in c#
- Category
- C#
- Title
- c# remove last character from string
- Category
- C#
- Title
- .net identity seed users and roles
- Category
- C#
- Title
- project tab unity
- Category
- C#
- Title
- unity mobile controls
- Category
- C#
- Title
- how to draw a dot in c#
- Category
- C#
- Title
- c# creating exceptions
- Category
- C#
- Title
- c# auto property set default value
- Category
- C#
- Title
- set decimal point c#
- Category
- C#
- Title
- C# check many strings quickly
- Category
- C#
- Title
- beard styles without mustache Intitle:work with me
- Category
- C#
- Title
- get random number c#
- Category
- C#
- Title
- unity rb.addexplosionforce 2d
- Category
- C#
- Title
- linq foreach c#
- Category
- C#
- Title
- how do loops on C#
- Category
- C#
- Title
- switch case c# range
- Category
- C#
- Title
- c# string to byte array
- Category
- C#
- Title
- loop gridcontrol devexpress c#
- Category
- C#
- Title
- c# bitmap to picturebox
- Category
- C#
- Title
- wpf restart application c#
- Category
- C#
- Title
- c# web form compare dates
- Category
- C#