示例#1
0
        private static double TestRunVoidWithCachedCall()
        {
            var instance   = new TestObject();
            var cachedCall = CachedCallFactory.Create(instance, "Run", new Type[] {});
            var start      = System.DateTime.Now;

            for (var i = 0; i < runCounts; i++)
            {
                cachedCall.Invoke(null);
            }
            var cost = (System.DateTime.Now - start).TotalMilliseconds;

            return(cost);
        }
示例#2
0
        private static double RunOneArgWithCachedCall()
        {
            var instance   = new TestObject();
            var cachedCall = CachedCallFactory.Create(instance, "Run", new Type[] { typeof(int) });
            var args       = new object[] { 1 };
            var start      = System.DateTime.Now;

            for (var i = 0; i < runCounts; i++)
            {
                cachedCall.Invoke(args);
            }
            var cost = (System.DateTime.Now - start).TotalMilliseconds;

            return(cost);
        }