Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time slow by application
Message
 
À
18/04/2003 11:16:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00778694
Message ID:
00779199
Vues:
21
Wow! What a great response in this thread! I may have made an unwarrented conclusion regarding CPU hogging - apologies (and thanks to all those who clarified the issue).

I should clarify:
Although it may not be due to high CPU utilization, I have found numerous interface problems in forms and applications that use the timer - especially when it's set for small intervals. The problems include menus and buttons that do not respond crisply, and difficulties with combos and tooltips.

The apps I have monitoring directories and events tend to need at least an administrative interface, and sometimes require end user input to re-order or manipulate tasks. Since the timer creates problems, I've stopped using it for short tight loops like that.

As a matter of fact, thinking about the problem at hand I might recommend looking into another Windows function that will monitor a directory in windows itself and send a message to your application when the directorys contents have changed. This is slick and may be the best of all worlds. A sample is here:

http://www.news2news.com/vfp/?example=117&function=168&xpg=

>>An application that uses the timer eats up a lot of CPU cycles and is probably screwing you up if it's running continuously. I recommend you look into using the SLEEP API function instead:
>>
>>http://www.news2news.com/vfp/?group=58&function=80
>
>
>Hi Michael. PMFJI but why do you say a timer eats a lot of CPU cycles? For example - I create a simple form with a timer on it and set the interval to just 1 second and the timer event to display the time on the form. I then run this form and load the Windows task manager and the CPU usage is basically 0% to 1% - and this includes that I am running IE, VFP8, MS Outlook, and the task manager itself.
>
>I agree that SLEEP API is a good option but sometimes a timer is more flexible since it does not stop program execution.
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform