Represents a high-resolution timer.
Inheritance: ITimer
コード例 #1
0
        /// <summary>
        /// Sleeps during the specified time.
        /// </summary>
        /// <param name="time">The time, in milliseconds.</param>
        public static void Sleep(decimal time)
        {
            if (time < 0)
            {
                return;
            }

            if (Board.Current.IsRaspberryPi)
            {
                HighResolutionTimer.Sleep(time);
            }
            else
            {
                Thread.Sleep((int)time);
            }
        }
コード例 #2
0
ファイル: Timer.cs プロジェクト: tisma/IoT.Home.Pi
        /// <summary>
        /// Sleeps during the specified time.
        /// </summary>
        /// <param name="time">The time.</param>
        public static void Sleep(TimeSpan time)
        {
            if (time.TotalMilliseconds < 0)
            {
                return;
            }

            if (Board.Current.IsRaspberryPi)
            {
                HighResolutionTimer.Sleep(time);
            }
            else
            {
                Thread.Sleep(time);
            }
        }