Gary,
In addition to the other comments.
I normally use QueryPerformanceCounter, as its compatible with Performance
Counters. For example I can define a Performance Counter that shows Time Per
Operation very easily with QueryPerformanceCounter & the PerformanceCounter
class...
Following are some KB articles that show you how to use
QueryPerformanceCounter to time your code.
Use QueryPerformanceCounter to Time code in VB.NET:
http://support.microsoft.com/default...b;en-us;306978
Use QueryPerformanceCounter to Time code in C#:
http://support.microsoft.com/default...b;en-us;306979
Use QueryPerformanceCounter to Time code in C++ .NET:
http://support.microsoft.com/default...b;en-us;815668
NOTE: It appears that VS.NET 2005 (aka Whidbey, due out later in 2005) will
have a StopWatch class that internally will decide between
QueryPerformanceCounter & Environment.TickCount:
http://msdn2.microsoft.com/library/ebf7z0sw.aspx
Hope this helps
Jay
"Gary" <sp**@spam.net> wrote in message
news:R1*****************@news-server.bigpond.net.au...
Hi,
How does one set up a timer so I can measure the time to do an event?
Something like this I guess the format would be,
start timer...
(do event)
...stop timer
display total time in seconds in a msg box
thanks,
Gary