Solved

A constantly running app

Posted on 2003-11-15
3
160 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
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 125 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

778 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