Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
15 minute delay in prg
Message
De
29/01/2008 04:14:28
 
 
À
29/01/2008 00:49:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01286463
Message ID:
01286483
Vues:
19
>>Hi. Is there a way to put a 15 minute delay in a prg? DO WHILE takes 100,000,000 loops just to get 1 minute!
>
>There are several ways - a DO WHILE loop is probably amongst the worst, as it will use 100% of a CPU if you let it, and a fixed number of loops will take different amounts of time on CPUs of different speeds.
>
>An old Fox way to do it is INKEY():
>
>=INKEY( 900 ) && pauses for 900 seconds (15 minutes)
>
>
>You could use the WinAPI Sleep function: http://news2news.com/vfp/?group=58&function=80
>
>Or, you could use a VFP timer control, and set its .Interval property to 900000 (900,000 milliseconds, equal to 900 seconds or 15 minutes).

The more you have to be certain of the exact time of restart, the more I'ld argue for a faster timer (say around 100-10000ms) checking clock time against a start time as a property. 9000 timer wakeups and checks is nothing making the cpu load twitch...

thomas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform