|
-
Feb 2nd, 2001, 07:40 AM
#1
Thread Starter
Black Cat
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
-
Feb 2nd, 2001, 07:45 AM
#2
Fanatic Member
-
Feb 2nd, 2001, 11:59 AM
#3
Thread Starter
Black Cat
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
-
Feb 5th, 2001, 08:53 AM
#4
Addicted Member
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.
-
Feb 5th, 2001, 08:58 AM
#5
transcendental analytic
TimeSerial(0, DateDiff("n", "8:17AM" , "5:47PM"),0)
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 18th, 2003, 12:32 AM
#6
Junior Member
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|