LTLhawk
asked on
A constantly running app
Hi,
I am creating an app that will log stats for a game server that I run. The app will check the status of a fiile and if the file changes then the app will retrieve data from that file and add it to a database. The app will check this file once every minute and if the files changed then it does its thing. My question is this: What do I use as a timer ? Do I use just a simple timer to count down from 1 minute over and over again or is there a more efficient way to do this. I do not want to the program to eat up CPU time if possible.
thanks
I am creating an app that will log stats for a game server that I run. The app will check the status of a fiile and if the file changes then the app will retrieve data from that file and add it to a database. The app will check this file once every minute and if the files changed then it does its thing. My question is this: What do I use as a timer ? Do I use just a simple timer to count down from 1 minute over and over again or is there a more efficient way to do this. I do not want to the program to eat up CPU time if possible.
thanks
If your app does not need an user interface, you could use a sleep to accomplish this. If it uses an user interface, using a timer would be best.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
very good ideas..the app does not need a user interface so I will look into sleep. thank you very much people