Say I have a simple program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ProfilerTesting
{
class Program
{
static void MyFunc<T>(T t)
{
System.Threading.Thread.Sleep(100);
Console.WriteLine(t);
}
static void Main(string[] args)
{
IList<string> l = new List<string> { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m" };
foreach (string s in l)
{
MyFunc(s);
}
IList<int> g = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
foreach (int i in g)
{
MyFunc(i);
}
}
}
}
When I profile this program using a .Net profiler (I've tried both EQUATEC profiler free version and the Visual Studio performance tools) in sampling mode, it gives me total execution statistics for MyFunc<T>
only. Is there any way I can get separate execution statistics for MyFunc<string>
and MyFunc<int>
?