-
大小: 4.05KB文件類型: .zip金幣: 1下載: 0 次發布日期: 2021-02-24
- 語言: C#
- 標簽: C#??FastMethodIn??
資源簡介
C# FastMethodInvoker
代碼片段和文件信息
using?System;
using?System.Reflection;
using?System.Reflection.Emit;
using?System.Collections.Generic;
using?System.Text;
using?System.Diagnostics;
namespace?FastMethodInvoker
{
????public?delegate?object?FastInvokeHandler(object?target?object[]?paramters);
????public?delegate?void?SayHandler(string?word);
????class?Program
????{
????????static?object?InvokeMethod(FastInvokeHandler?invoke?object?target?params?object[]?paramters)
????????{
????????????return?invoke(null?paramters);
????????}
????????static?void?Main(string[]?args)
????????{
????????????Type?t?=?typeof(Person);
????????????MethodInfo?methodInfo?=?t.GetMethod(“Say“);
????????????Person?person?=?new?Person();
????????????string?word?=?“hello“;
????????????Person?p?=?null;
????????????object[]?param?=?new?object[]?{?word?p?3?};
????????????Stopwatch?watch?=?new?Stopwatch();
????????????watch.Start();
????????????for?(int?i?=?0;?i?1000000;?i++)
????????????{
????????????????m
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????940??2006-06-28?11:10??FastMethodInvoker\FastMethodInvoker.sln
?????目錄???????????0??2006-07-05?22:36??FastMethodInvoker\FastMethodInvoker\
?????文件????????1968??2006-06-28?11:10??FastMethodInvoker\FastMethodInvoker\FastMethodInvoker.csproj
?????文件????????6869??2006-07-05?22:35??FastMethodInvoker\FastMethodInvoker\Program.cs
?????目錄???????????0??2006-06-28?11:10??FastMethodInvoker\FastMethodInvoker\Properties\
?????文件????????1294??2006-06-28?11:10??FastMethodInvoker\FastMethodInvoker\Properties\AssemblyInfo.cs
- 上一篇:C#(switch/if)入門級
- 下一篇:c# 猜數游戲
評論
共有 條評論