?
Solved

Process Timing

Posted on 1998-08-26
7
Medium Priority
?
214 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 60 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

800 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