Reputation: 4026
Hi i want to find out the longest time needed to call a method or to create an object.
I thought of something like calling GC.Collect()
before creating the object or during the method or calling some destructors.
Has anyone some hints or ideas for finding out some (or the) worst case scenarios?
best regards
Upvotes: 3
Views: 594
Reputation: 126
See this thread. Put the answer code in a loop and record lowest & highest time that come in. But that may not be actually that intersting. Here is better performance meassaring:
Run the code in you actual application to get a feel of a real life scenario
or
Run a test on say 100000 calls to whatever method you want to test then you can take an average of the call times which should give you a better indication if your method is slow or not
Upvotes: 1