![]() The application thread then blocks until the AutoResetEvent object is signaled. The application thread creates the timer, which waits one second and then executes the CheckStatus callback method every 250 milliseconds. Indicates the number of times the callback method has been invoked.ĭetermines the maximum number of times the callback method should be invoked. The StatusChecker class also includes two state variables: The state argument of the CheckStatus method is an AutoResetEvent object that is used to synchronize the application thread and the thread pool thread that executes the callback delegate. ![]() The following example defines a StatusChecker class that includes a CheckStatus method whose signature is the same as the TimerCallback delegate. IDisposable IAsyncDisposable ITimer Examples ![]() Implements ITimer Public NotInheritable Class Timer Implements IAsyncDisposable, IDisposable Public NotInheritable Class Timer Implements IDisposable Public NotInheritable Class Timer Interface IDisposable Public NotInheritable Class Timer ![]() Public sealed class Timer : MarshalByRefObject, IDisposable Public sealed class Timer : IDisposable public sealed class Timer : MarshalByRefObject, IAsyncDisposable, IDisposable public sealed class Timer : MarshalByRefObject, public sealed class Timer : MarshalByRefObject, IDisposable public ref class Timer sealed : IDisposable public ref class Timer sealed : MarshalByRefObject, IAsyncDisposable, IDisposable public ref class Timer sealed : MarshalByRefObject, System::Threading::ITimer public ref class Timer sealed : MarshalByRefObject, IDisposable Provides a mechanism for executing a method on a thread pool thread at specified intervals. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |