using System; using System.Collections.Generic; using System.Text; using ProcessHacker.Native.Objects; namespace ProcessHacker.Native.Threading { /// /// Provides methods for manipulating the current thread. /// public static class CurrentThread { /// /// Switches to another thread. /// public static void Sleep() { Yield(); } /// /// Suspends execution of the current thread. /// /// The interval to sleep, in milliseconds. public static void Sleep(int interval) { ThreadHandle.Sleep(interval, true); } /// /// Suspends execution of the current thread. /// /// The time at which wake up. public static void Sleep(DateTime time) { ThreadHandle.Sleep(time.ToFileTime(), false); } /// /// Switches to another thread. /// public static void Yield() { ThreadHandle.Yield(); } } }