Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timed events
Message
 
To
10/01/2005 18:18:56
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00975807
Message ID:
00975912
Views:
15
>>>Set the interval to 10000 and the timer event will fire every 10 seconds.
>>>
>>>>This sound inaccurate. Seems like it could wander using this method. That's why I figured if every 10 seconds I could look and see if my machine time (atomic time) was 05:59 I would play the wav. Your method leaves me at the mercy of the internal clock tick correct?
>>
>>So how do I keep it from firing every 10 seconds during 05:59 till 06:00?
>
>You don't. It fires, checks the current system time against the next event time, and if the time is up (i.e. current system time equal or greater than event time), it fires the event, and sets this.nextEventTime to the time of the next event.
>
>Suppose it fires at 5:59:04. It sees that the current event is supposed to happen no earlier than 5:59:00, so it fires the event (i.e. plays the sound, makes coffee, whatever you tell it to do), and then it looks up the next event - it's scheduled for 6:00:00.
>Next time it fires at 5:59:14, sees it's not 6:00:00 yet, and does nothing.
>Next time it fires at 5:59:24, sees it's not 6:00:00 yet, and does nothing.
>...
>Next time it fires at 6:00:04, sees it's past 6:00:00 now, and launches the 6:00 event, looks up the next event etc etc.

Thank you all! This message finally made it sink in. Our factory buzzer died due to a roof leak and this will get the buzzer in sync with our data collection clocks. Our 150 employees will be very happy!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform