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); }
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; }
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); }
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); }
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)); }
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); }