|
Execute the following
Microsoft SQL Server T-SQL script in Query Editor to flush memory clean in preparation for a timing measurement:
USE AdventureWorks
GO
DBCC DROPCLEANBUFFERS -- Clears the data cache
DBCC FREEPROCCACHE -- Clears the procedure cache
declare @StartTime datetime
set @StartTime = getdate()
/*
PUT SCRIPT HERE ******************************
*/
print 'Duration in msec = '
+ convert(varchar, datediff(ms, @StartTime, getdate()))
GO
Related article:
http://www.sqlusa.com/bestpractices2005/executioninms/
|