예제 #1
0
        public void Sleep(int millis)
        {
#if !NETCOREAPP1_0
            TimingProvider.Sleep(millis);
#else
            // in order to avoid long sleeps (netcore1.0 doesn't provide ThreadInterruptException for sleep)
            const int sleepTimePerCycle = DEFAULT_SLEEP_TIME_MILLISECONDS;
            while (millis > 0)
            {
                TimingProvider.Sleep(Math.Min(sleepTimePerCycle, millis));
                millis -= sleepTimePerCycle;
                if (isShutdownRequested)
                {
                    break;
                }
            }
#endif
        }
예제 #2
0
 public void Sleep(int millis)
 {
     TimingProvider.Sleep(millis);
 }