What is the best way to measure execution time of a function?

inspite picture inspite · Dec 19, 2008 · Viewed 117k times · Source

Obviously I can do and DateTime.Now.After - DateTime.Now.Before but there must be something more sophisticated.

Any tips appreciated.