Solved

C++ Timer Class

Posted on 1997-02-25
1
183 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
Comment Utility
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

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

762 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

9 Experts available now in Live!

Get 1:1 Help Now