Java Timer vs ExecutorService?

According to Java Concurrency in Practice: Timer can be sensitive to changes in the system clock, ScheduledThreadPoolExecutor isn’t. Timer has only one execution thread, so long-running task can delay other tasks. ScheduledThreadPoolExecutor can be configured with any number of threads. Furthermore, you have full control over created threads, if you want (by providing ThreadFactory). Runtime … Read more

Scheduling without use of timer class in c#

You can try something basic like this: public class TimeSchedule { private bool hasRun; private DateTime targetDate = new DateTime(2015,5,26); private void Schedule() { while (!hasRun) { if (DateTime.Now.Date < targetDate) { //Do something hasRun = true; } else { Thread.Sleep(1000); } } } public void Start() { var thread = new Thread(Schedule); thread.Start(); } … Read more