0

I was trying to measure the execution times of the c programs for efficiency by executing the .exe as process in C# and finding the time with TotalProcessorTime property.
But the problem i have been facing is that, when i run the process for more than a couple times, the TotalProcessorTime property is turned to zero.Even though the program executes completely.
I tried to create a separate thread and run the process on that, but
even then same problem persists.

Can anyone tell me why ? or if there is better way to measure the execution time.

P.S Stopwatch,Timer are much worse, they have a very large variation.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by lighthead
0

Thanks ddanbe for the above link. I solved part of the problem.I am able to get almost consistent timings for the execution time. But the ExecutionStopwatch gives zero as the execution times most of the time.
I tried running it on the same thread and on different threads,
but the result is the same.
Is there any reason the time can be zero ?

I will be really grateful if anyone helps..................

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.