Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer on a form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00183160
Message ID:
00183219
Vues:
17
>I have a timer on a form, and I want to launch another form that has activities to do based on this timer, while the original form's timer is still ticking time.
>
>Basically both forms are doing things at the same time. I guess this would be considered mulit-threading? If what I have read is correct this doesn't appear to be possible?

No, VFP is still single-threaded. If your processing based on a timer is longer then the tick of the timer, you better stop the timer when the processing starts and restart it when the processing ends (otherwise the timer events will stack up and your application will jam). If you have more than one timer, the total processing time based on timer events should not be longer than the shortest tick. Otherwise, you have to stop/restart the timers accordingly. From my experience: write the processing code and test on the slowest machine your app will be used on. If the app jams, apply the stop/start method or enlarge the tick interval. If you chose to enlarge the interval, use the value that works from your tests multiplied by 2 (other processes may also take time on user's machine).

If the processing time is much smaller than the tick, don't worry about having more than one timer. Since VFP is single threaded, you don't have any synchronization problems, etc.

Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform