Get The Time When The Program Execute
C#
4
Posts
3
Posters
0
Views
1
Watching
-
Do you mean
DateTime.Now
? Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji -
Just record the time when the application/method begins execution and diff the time when it stops.
DateTime start = DateTime.Now;
// .. do something
TimeSpan duration = DateTime.Now - start;
Console.WriteLine("Ran for {0} milliseconds.", duration.Milliseconds);This is basically what Christian's source that someone mentioned is doing. I mean, how else would you do it? If you want a more thorough solution, I recommend a CLR profile like this free one[^] from Microsoft.
Microsoft MVP, Visual C# My Articles