How to determin processor cycles?

Posts   
 
    
wayne avatar
wayne
User
Posts: 611
Joined: 07-Apr-2004
# Posted on: 12-Nov-2004 10:59:13   

Hi All

I need to compare two 3rd party encryption libs that offers simular functionality.

How do I determin which one is the fastest or the cheapest (refering to processing time)

Speed is quite important !!

How do i go about this? 1. Do I get the ticks before and after a process and then subtract the two from each other?

  1. And how do i ensure that my tests following after the first does not use cached objects.

I need to do Process 1 - get time - do Process 2 - get time. - I find that my tests following after Process 1 is always faster - I need the worst case sinarios....

Thanks

jtgooding
User
Posts: 126
Joined: 26-Apr-2004
# Posted on: 12-Nov-2004 14:14:06   

Ticks are easy:

tickCount = System.Environment.TickCount;

Difference can be done with simple subtraction.

To insure that you are not using cached components, load your process into a seperate AppDomain and destroy the AppDomain in between runs.

John