Solved

C++ Timer Class

Posted on 1997-02-25
1
192 Views
Last Modified: 2006-11-17
I'm a graduate student trying to write a simple logic simulator (taking into account timing delays).  Does anyone
have a timer class or any advice or info to help w/ the timing in a project like this?  The class must keep track of timing and schedule events to happen at certain times.  I should add, the program will most likely be a DOS program for now.
0
Comment
Question by:mneace
1 Comment
 
LVL 1

Accepted Solution

by:
vanbasco earned 100 total points
ID: 1162264
Well, if you write your programs for Windows by using MFC, then I've got
a solution. The class CWnd (and or course all derivates like CDialog or
CButton) has a method called "SetTimer". Here you can specify that Windows shall send a WM_TIMER message every n milliseconds. You
just have to implement the virtual afx method OnTimer, which is called
every time your window receives this WM_TIMER Message.
Hope this helps.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

733 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