The speed of the code 
Author Message
 The speed of the code

Hi,
  How can I count the speed of my program?  I use 32-bit c compiler.
I just use the system clock to count but it varies a lots.
Thanks
Alex


Mon, 23 Apr 2001 03:00:00 GMT  
 The speed of the code

Quote:

>   How can I count the speed of my program?  I use 32-bit c compiler.
> I just use the system clock to count but it varies a lots.

Hi alex,

One way is to simply make the program "burn" a lot of time, ie. give
it lots of data or simply create an outer loop in a way that the
part you want to measure is executed several times. If you manage
to get the time being consumed into the seconds range, you should
get fairly reliable figures when using the "clock()" function.

Wall clock time or a stop watch can be very unriliable in a multiuser
or multiprocessing environment, where a lot of processing happens
in the background, consuming almost random amounts of time.

But please read up on what accuracy "clock()" returns on your system,
as this is system specific.

Stephan
(initiator of the campaign against grumpiness in c.l.c)



Mon, 23 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Problem with Visual Studio .NET (C++) - Maximise Speed (/O2) - Unmanaged Code

2. Optimization for Maximum speed generates wrong code

3. how to speed up the code?

4. Tool for measuring speed of C code wanted

5. Speed of generated code

6. Hi speed find / replace code

7. Bad Address from Speed Optimized Code

8. Speed difference in Managed and Unmanaged code

9. Need code to compare speed of two computers.

10. c/c++ Code speed after threading ??

11. How to optimize execution speed of code ??

12. Use of static to speed up code?

 

 
Powered by phpBB® Forum Software