/// <summary>
        /// Sleep for "duration" number of seconds. However, if during the sleep that the wakeupCall fuction returns true, then Sleep will exit immediately.
        /// </summary>
        /// <param name="wakeupCall"></param>
        /// <param name="duration"></param>
        public static void Sleep(WakeFunction WakeupCall, int duration)
        {
            for (int i = 0; i < duration; i++)
            {
                if (WakeupCall())
                {
                    break;
                }

                Thread.Sleep(1000);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sleep for "duration" number of seconds. However, if during the sleep that the wakeupCall fuction returns true, then Sleep will exit immediately.
        /// </summary>
        /// <param name="wakeupCall"></param>
        /// <param name="duration"></param>
        public static void Sleep(WakeFunction WakeupCall, int duration)
        {
            for (int i = 0; i < duration; i++)
            {
                if (WakeupCall())
                {
                    break;
                }

                Thread.Sleep(1000);
            }
        }