Solved

Process Timing

Posted on 1998-08-26
7
202 Views
Last Modified: 2013-11-19
I am working on some realtime data acquisition and I want to time a preocess in my program. I need to know how long it takes to Invalidate a whole screen and if I wrote a function how long it takes to process that function..How do I do that ?
0
Comment
Question by:guranimo
[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
  • 4
  • 2
7 Comments
 
LVL 7

Expert Comment

by:psdavis
ID: 1321304
Have you looked at the profiling option available for VC5?  It's not overly exciting but it can give you some of the information you might be looking for.

Phillip
0
 
LVL 1

Accepted Solution

by:
jeremydavis earned 20 total points
ID: 1321305
long int howlong = 0;

void function(void)
{
   SetTimer(111, 1L, NULL);
   //1L = 1mS timer
      :
      :
      //do something
      :
      :
   KillTimer(111);
   TRACE("To in function = %ld\n", howlong);
}

void OnTimer(UINT nIDEvent)
{
   // TODO: Add your message handler code here and/or call
 
   howlong++;      
   CDialog::OnTimer(nIDEvent);
   //CDialog::OnTimer() is assuming you have a dialog base app
}
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1321306
*Probably* a nieve answer.  If I'm not mistaken, the OnTimer function is always the last on the stack of things to do.  You'd probably not get any responses at all.

Phillip
0
Industry Leaders: 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!

 
LVL 1

Expert Comment

by:jeremydavis
ID: 1321307
If you do find the OnTimer last on the stack you could always use the old favourite PeekAndPmup to allow processing allotment for the timer
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1321308
I'd still doubt that it would work.
0
 

Expert Comment

by:tsauy
ID: 1321309
Another function, GetTickCount(), may do better job than SetTimer(), because the former is from the system clock and supposed to be very accurate. However, if you need a stopwatch with time resolution better than 1 msec, both GetTickCount() and SetTimer() are out of scope. For win95/98, the time resolution of SetTimer() is around 20-50 msec, according to my experiments (somebody corrects me if I am wrong).
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1321310
Thank you tsauy.  That's what I was thinking of!
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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 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