簡単なプログラムがあるとします:
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);
}
}
}
}
サンプリング モードで .Net プロファイラー (私は EQUATEC プロファイラー フリー バージョンと Visual Studio パフォーマンス ツールの両方を試しました) を使用してこのプログラムをプロファイリングすると、合計実行統計MyFunc<T>
のみが得られます。と の個別の実行統計を取得する方法はありMyFunc<string>
ますMyFunc<int>
か?