Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timed events
Message
De
10/01/2005 18:18:56
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
00975807
Message ID:
00975890
Vues:
14
>>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform