-
In an alarm-clock like application, what is the best way to query the time? Right now I'm using a Timer that fires every 60 seconds, checks the time, and if it's the set time, play a .wav of the user's choice. The drawback is the clock can change, and up to 59 seconds could go by before the sound is played. Now, I could have the timer fire every second, and if it's the right time, play the sound and keep track of that for a minute. It seems to me it would be better to keep the amount of times the timer fires to a minimum, as most of the time the program is not going to need to do anything. Is there a better way I can sync with the time, perhaps with an API call or something?
Josh
-
You can create a Timer using the SetTimer API and terminate it using the Killtimer API. You could also use the GetTickCount API for this purpose
-
Yeah, thanks, I suppose I could set the timer's length to be the difference between the time of the user clicking okay and the time they have set the alarm for.
A Long in milliseconds should be about 600 hours, right?
Josh
-
Timer
I making a program were it total the the employee time from the time he check in say 8:17AM to 5:47PM. Can any show me how to find out the time in Hour in minutes.
-
TimeSerial(0, DateDiff("n", "8:17AM" , "5:47PM"),0)
-
just a thought, might not want to hard code the times like that... kinda defeats the purpose. Try to get around it using textboxes. but of course you already knew that...