Solved

C++ Timer Class

Posted on 1997-02-25
1
201 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
[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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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.

724 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