3

My main problem is that I don't know how to search what I'm looking for in google,because I get different results(probably its not count-down timer).

I want to calculate how much time a function takes to be executed.The instructions take a long time in seconds to be executed(seconds,not miliseconds).

How to do it in C#/NET,example?

Gordon Bell
  • 13,337
  • 3
  • 45
  • 64
Ivan Prodanov
  • 34,634
  • 78
  • 176
  • 248
  • possible duplicate of [Is DateTime.Now the best way to measure a function's performance?](http://stackoverflow.com/questions/28637/is-datetime-now-the-best-way-to-measure-a-functions-performance) – devnull Mar 08 '14 at 08:24

2 Answers2

11

You want to use the StopWatch.

See this question for more detail.

Is DateTime.Now the best way to measure a function's performance?

Community
  • 1
  • 1
David Basarab
  • 72,212
  • 42
  • 129
  • 156
1

If you are looking to find bottlenecks in you application you can check out the CLR Profiler as a starting point.

heavyd
  • 17,303
  • 5
  • 56
  • 74