예제 #1
0
 public static bool RequiresMoreTime(DeveloperTools.Code code1, DeveloperTools.Code code2, int times = 1)
 {
     if (DeveloperTools.GetTimeDifference(code1, code2, times).TotalMilliseconds > 0)
     {
         return(true);
     }
     return(false);
 }
예제 #2
0
		public static bool RequiresMoreTime(DeveloperTools.Code code1, DeveloperTools.Code code2, int times = 1)
		{
			if (DeveloperTools.GetTimeDifference(code1, code2, times).TotalMilliseconds > 0)
			{
				return true;
			}
			return false;
		}
예제 #3
0
        public static bool DoesWin32MethodExist(string moduleName, string methodName)
        {
            IntPtr moduleHandle = DeveloperTools.GetModuleHandle(moduleName);

            if (moduleHandle == IntPtr.Zero)
            {
                return(false);
            }
            return(DeveloperTools.GetProcAddress(moduleHandle, methodName) != IntPtr.Zero);
        }
예제 #4
0
		public static TimeSpan CalculateTime(DeveloperTools.Code code, int times = 1)
		{
			if (times < 1)
			{
				times = 1;
			}
			long ticks = (long)0;
			long num = (long)0;
			ticks = DateTime.Now.Ticks;
			for (int i = 0; i < times; i++)
			{
				code();
			}
			num = DateTime.Now.Ticks;
			return TimeSpan.FromTicks(num - ticks);
		}
예제 #5
0
        public static TimeSpan GetTimeDifference(DeveloperTools.Code code1, DeveloperTools.Code code2, int times = 1)
        {
            TimeSpan timeSpan = DeveloperTools.CalculateTime(code1, times);

            return(timeSpan - DeveloperTools.CalculateTime(code2, times));
        }
예제 #6
0
		public static TimeSpan GetTimeDifference(DeveloperTools.Code code1, DeveloperTools.Code code2, int times = 1)
		{
			TimeSpan timeSpan = DeveloperTools.CalculateTime(code1, times);
			return timeSpan - DeveloperTools.CalculateTime(code2, times);
		}