Friday, January 21, 2011

SqlServer: A simple stop-watch for performance monitioring

Declare @Stopwatch datetime
Set @Stopwatch=GetDate()

Do something here

Print DateDiff(ms, @Stopwatch, GetDate()); -- display the elapsed time in milliseconds
Set @Stopwatch = GetDate() -- reset the stop watch

No comments:

Post a Comment

Remember, if you want me to respond to your comment, then you need to use a Google/OpenID account to leave the comment.