/// <summary> /// Pass a double to sleep for fractions of a second. (0.1 sleeps for around 1/10 second) /// /// Do not use this method where accurate time is important. Accuracy will get worse with values of many seconds. /// </summary> /// <param name="seconds"></param> public static void WinSleep(double seconds) { // Handle very very short if (seconds < 0.002) { WinMacros.WinSleepShort(2); } else if (seconds <= 1) { WinMacros.WinSleepShort((int)(seconds * 1000)); } else { WinMacros.WinSleepLong((int)(seconds * 100)); } }
/// <summary> /// Pass int seconds to sleep a number of seconds. /// /// Do not use this method where accurate time is important. Accuracy will get worse with values of many seconds. /// </summary> /// <param name="seconds"></param> public static void WinSleep(int seconds) { WinMacros.WinSleepLong(seconds); }