Solved

C++ Timer Class

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

911 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