I'm making an application that will notify the user every 1, 5 or 30 minute or even every hour. For example the user opens the program in 5:06 and the program will notify the user in 6:06.
So my current code is notifying the user every 5 minutes using Thread.Sleep() function, but I find it kinda lame.
This is my code:
public void timeIdentifier()
{
seiyu.SelectVoiceByHints(VoiceGender.Female);
while(true)
{
string alarm = String.Format("Time check");
seiyu.Speak(alarm);
string sayTime = String.Format(DateTime.Now.ToString("h:mm tt"));
seiyu.Speak(sayTime);
// It will sleep for 5 minutes LOL
Thread.Sleep(300000);
}
}