Waitable timer?

  • Thread starter Thread starter Dinesh Eswaran
  • Start date Start date
D

Dinesh Eswaran

hi all,

I want to create a waitable timer in C#. How do I do it? There is
Timer class and there is the WaitHandle class with WaitAny... methods.
But they dont seem to help. Basically iam looking for the C# version
of platform SDK's SetWaitableTimer

Thanks
Dinesh
 
Jackson Davis said:
Take a look at System.Threading.Timer and
System.Threading.TimerCallback. TimerCallback executes on a threadpool
thread seperate from the thread that created the timer so you should
be able to use an AutoResetEvent or mutex to simulate a waitable
timer. That is, create the timer in one thread and block on a
synchronization object. In the timercallback, signal the sync object.
The example on MSDN at

Thank you. Your comments helped.

- Dinesh
 
Back
Top