|
-
April 29th, 2004, 05:45 AM
#1
How to measure the time taken to run a certain process?
Hi there...
Would like to check with experts of Visual C++ out there..how am I able to get the time taken to run a centain portion of my program.
my current method is
StartClock = clock();
for (i = 0; i<n; i++)
{
x = x + 1; // just an example
}
EndClock = clock();
durationClock = EndClock - StartClock ;
however, it seems that the StartClock and EndClock are the same... probably the function is too fast.
Is there another way to capture the timing?
Thanks.
Joseph
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|