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
Solved

C++ Timer Class

Posted on 1997-02-25
1
190 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

856 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