Solved

A constantly running app

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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

617 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