c#: classe System.Threading.Timer
using System.Threading;
...namespace Nicola.Timer
{
class EsempioTimer
{
static System.Threading.Timer timer;
System.Threading.TimerCallback cb = new System.Threading.TimerCallback(ProcessTimerEvent);public EsempioTimer() {}
public void Start()
{
timer = new System.Threading.Timer(cb, "", 0, 30000);
}private static void ProcessTimerEvent(object obj)
{
//...
//...
}public void Stop()
{
timer.Dispose();
}
}
}
EsempioTimer _et = new EsempioTimer();
_et.Start();
_et.Stop();
Leave a Reply