Solved

A constantly running app

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now