Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

A constantly running app

Posted on 2003-11-15
3
Medium Priority
?
168 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:LTLhawk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Expert Comment

by:Priyesh
ID: 9757650
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.
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 375 total points
ID: 9758265
SetTimer(1, 60000, NULL) should result in your app getting one WM_TIMER message every 60 seconds.  Next to no cpu overhead
0
 

Author Comment

by:LTLhawk
ID: 9758291
very good ideas..the app does not need a user interface so I will look into sleep. thank you very much people
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question