1

I'm currently writing a C# application that will schedule an event to be fired at a specific time. I started off using the Quartz library for scheduling the event, but my issue is that I need to guarantee that the event will fire within a given second, and Quartz does not offer that precision.

I could spawn a thread via Quartz a few minutes before the actual scheduled time, then just have a loop that tests if the current second is correct.

Is there a better way to do this?

Carson
  • 45
  • 6

1 Answers1

2

Couple ways to do this:

  1. If the application is running at all times, it can use a Timer to check if a specific time has come. If it has, it will fire the method/command to run. Here's some more basic info/tutorial on Timers: http://www.dotnetperls.com/timer

  2. If you are wanting the event to fire when the application is not even running, you can look at creating a Task for the event you want it to perform. Link to creating a Task is here: Creating Scheduled Tasks

Community
  • 1
  • 1
Ryan C
  • 572
  • 5
  • 18