How to create stopwatch?

Login to reply to this topic.
Tue, 2006-02-14 06:29
Joined: 2005-05-09
Forum posts: 53
Hi All,

I want to calculate the time taken to execute a function.
How to do it?

Thanks for the time.
Pooja.


Tue, 2006-02-14 08:28
Joined: 2005-06-21
Forum posts: 107
Re: How to create stopwatch?
You can use CPeriodic for setting timer to do your function . Open Graphics Example in SDK and search . Good luck to you !
Tue, 2006-02-14 10:03
Joined: 2005-05-09
Forum posts: 53
Re: How to create stopwatch?
Hi Doctin,

Do i need to use active object for this?

I want to find the duration of a particular task...
I did it in this way.

//Before calling the function.
TTime time1;
time1.HomeTime();

//After returning from function.
TTime time2;
time2.HomeTime();
TTimeIntervalMicroSeconds micro;
//find the time interval b/w time1 and time2 in microseconds.
micro = time2.MicroSecondsFrom(time1);

Is there any other approach to achieve this?

Thanks for the time.
Pooja
  • Login to reply to this topic.