But I'm not sure it will work the way you want. The code just checks the current time and unless you repeatedly keep checking this condition you won't be able to react on a time in the future. Maybe the framework that you're using has some kind of callback mechanism based on time that you can use.