Task scheduler for a particular application This isn't meant as a scheduler for just any job. The job that I need to schedule here is very specific for an application I'm writing for one of my clients.

The scheduler will run as a console application because it's comparatively lightweight. The application will be started with Windows (startup items in the Registry) and should always be running - much like a Windows service but not (mostly because I don't have a project template for a Windows service in VS 2013 Community).

The task this scheduler runs should be done at 4am every day.

Does it look like the code below matches this description of the requirements?

class MyScheduledTask
{
    private static Timer _timer;

    static void Main(string[] args)
    {
        SetTime();
    }

    private static void SetTime()
    {
        DateTime currentTime = DateTime.Now;
        int interval = 0;
        DateTime scheduleTime = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, 12, 45, 0);

        if (currentTime &lt;= scheduleTime)
        {
            interval = (int)scheduleTime.Subtract(currentTime).TotalSeconds;
        }
        else
        {
            interval = (int)scheduleTime.AddDays(1).Subtract(currentTime).TotalSeconds;
        }

        _timer = new Timer(interval);
        _timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed);
        _timer.Start();
    }

    void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
    {
        StartTaskWork();
        _timer.Interval = (24 * 60 * 60 * 1000);
    }
}
First, I'd mention that scheduling execution of anything in Windows is better done through the Windows Task Scheduler. Scheduling your application that way would remove the &quot;must run everyday at 4AM&quot; requirement from the code, although I don't see how your code is enforcing that.
That said...
Magic Numbers &amp; Configuration

DateTime scheduleTime = new DateTime(currentTime.Year, currentTime.Month, currentTime.Day, 12, 45, 0);


&quot;12&quot; and &quot;45&quot; (and &quot;0&quot;) are magic numbers here. These should be taken from configuration, or better yet, from command-line arguments.

The right hammer for the right nail
System.Int32 is an awesome hammer. But that doesn't make every number a nail.

int interval = 0;


You (present you - future you could be a different story) know they're seconds. But the name says nothing of it, and the type is making your life harder than it needs to be. The .NET framework has a struct specifically meant to represent a time interval, more precisely a time span - System.TimeSpan. Compare readability here:
TimeSpan interval = TimeSpan.FromSeconds(0);

Ambiguity: gone. And as a bonus, you no longer need to cast anything here:
    if (currentTime &lt;= scheduleTime)
    {
        interval = scheduleTime.Subtract(currentTime);
    }
    else
    {
        interval = scheduleTime.AddDays(1).Subtract(currentTime);
    }

Oh, and it turns this:

_timer.Interval = (24 * 60 * 60 * 1000);


Into that:
_timer.Interval = TimeSpan.FromDays(1).TotalMilliseconds;

And that rids the code of an implicit conversion from int to double, since both TimeSpan.TotalMilliseconds and Timer.Interval are double.