I have been looking for a while on how I can make this work. For instance:
CheckPerformance(***Loop***);
private void CheckPerformance(***Function myFunctionName***)
{
sw.Start();
myFunctionName(200);
sw.Stop();
Console.WriteLine("Elapsed in check: {0}", sw.Elapsed);
}
private void Loop(int n)
{
for (int i = 0; i < n; i++)
{
int number = i;
}
}
How would I be able to pass Loop as the argument to dynamically put functions into CheckPerformance() like this stop watch profiler? Even if you give me a name for this type of thing I can look it up.
Thanks!