Creating a background thread
using System.Threading;
//----- START OUR HIGH PRIORITY BACKGROUND THREAD -----
//This thread is going to run in the background
Thread newThread = new Thread(MyBackgroundThread);
newThread.Priority = ThreadPriority.Highest; //<<Set as needed
newThread.Start();
//************************************************
//********** BACKGROUND LOOPING THREAD ***********
//************************************************
private void MyBackgroundThread()
{
while (true)
{
try
{
Thread.Sleep(1000); //Delay in mS
}
catch (Exception )
{
}
} //while (true)
}
Creating an accurate timer based looping background thread
See here.
