using System;
/// Schedule the given action for the given time. From @steve Cherry -- https://stackoverflow.com/questions/1493203/alarm-clock-application-in-net
public async void ScheduleAction ( Action action , DateTime ExecutionTime )
{
try
{
await Task.Delay ( ( int ) ExecutionTime.Subtract ( DateTime.Now ).TotalMilliseconds );
action ( );
}
catch ( Exception )
{
// Something went wrong
}
}