public void TimedMethod(TimerTestTable TTT) { JobScheduler jobScheduler = new JobScheduler(TimeSpan.FromMinutes(.25), new Action(() => { for (int i = 0; i <= TTT.RetrieveNumberOfRowsInTable(); i++) { Console.WriteLine(TTT.RetrieveTableRow(TTT.TableName, i)); } })); jobScheduler.Start(); // To Start up the Scheduler //jobScheduler.Stop(); // To Stop Scheduler from Running. }
static void Main(string[] args) { DataBaseOperations.ConnectToDB(); TimerTestTable TTT = new TimerTestTable(); /* * List<String> list = new List<String>(); * list.Add("Q3"); * list.Add("A3"); * list.Add("QType3"); * TTT.InsertRowIntoTable(TTT.TableName, list); */ Timer timer = new Timer(); timer.TimedMethod(TTT); Console.ReadKey(); }