/** * testInvokeOfAnInstanceMethodWithoutInterface. * * @return */ public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface() { int count = 0; InvokeImpl invoke = new InvokeImpl(); DateTime start = DateTime.Now; for (int i = NB_INVOKE_SETTER_TESTS; i != 0; i--) { // Write to force jre not to optimize the code if (i % 2 == 0) { count = count + invoke.echoWithSetVariable("1").Length; } else { count = count + invoke.echoWithSetVariable("0").Length; } } DateTime end = DateTime.Now; TimeSpan executionTime = end - start; Console.WriteLine("[InvokeTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INVOKE_TESTS + " invoke.echoWithSetVariable(\"1\").Length, count=" + count + ", snapshot time," + executionTime.TotalMilliseconds); return((long)executionTime.TotalMilliseconds); }
/** * testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface. * * @return */ public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface() { int count = 0; InvokeImpl invoke = new InvokeImpl(); DateTime start = DateTime.Now; for (int i = NB_INSTANCE_REFLECTION_TESTS; i != 0; i--) { count = count + invoke.echoWithSetVariable("1").Length; } DateTime end = DateTime.Now; TimeSpan executionTime = end - start; Console.WriteLine("[ReflectionTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INSTANCE_REFLECTION_TESTS + " invoke.echoWithSetVariable(\"1\").length() , count=" + count + ", snapshot time," + executionTime.TotalMilliseconds); return((long)executionTime.TotalMilliseconds); }
/** * testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface. * * @return */ public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface() { int count = 0; InvokeImpl invoke = new InvokeImpl(); DateTime start = DateTime.Now; for (int i = NB_INSTANCE_REFLECTION_TESTS; i != 0; i--) { count = count + invoke.echoWithSetVariable("1").Length; } DateTime end = DateTime.Now; TimeSpan executionTime = end - start; Console.WriteLine("[ReflectionTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INSTANCE_REFLECTION_TESTS + " invoke.echoWithSetVariable(\"1\").length() , count=" + count + ", snapshot time," + executionTime.TotalMilliseconds); return (long) executionTime.TotalMilliseconds; }
/** * testInvokeOfAnInstanceMethodWithoutInterface. * * @return */ public static long testInvokeOfAnInstanceMethodWithSetInstanceVariableWithoutInterface() { int count = 0; InvokeImpl invoke = new InvokeImpl(); DateTime start = DateTime.Now; for (int i = NB_INVOKE_SETTER_TESTS; i != 0; i--) { // Write to force jre not to optimize the code if (i % 2 == 0) { count = count + invoke.echoWithSetVariable("1").Length; } else { count = count + invoke.echoWithSetVariable("0").Length; } } DateTime end = DateTime.Now; TimeSpan executionTime = end - start; Console.WriteLine("[InvokeTest], Invoke Of An Instance Method With Set Instance Variable Without Interface " + NB_INVOKE_TESTS + " invoke.echoWithSetVariable(\"1\").Length, count=" + count + ", snapshot time," + executionTime.TotalMilliseconds); return (long)executionTime.TotalMilliseconds; }