I have a simple Azure Worker role that performs a task every day at 12 o’clock. Below is the code that executes this.
public override void Run() { try { while (true) { int time = Convert.ToInt32(DateTime.Now.TimeOfDay); if (time == 12) { DoSomethingElse(); } } } catch (Exception ex) { Log.Add(ex, true); } }
Here, DoSomethingElse() is a method of sending emails every day at 12pm, and also fires once and only once a day.
How can I implement a scheduler that fires when the time is 12PM and execute DoSomethingElse() .
My question is: Is this (above code) the best method or is it using any third-party tool.
c # azure
Hop
source share