DECLARE @startTime datetime2;
DECLARE @endTime datetime2;
DECLARE @counter int = 0;
DECLARE @iterations int = 1000;
SET @startTime = SYSDATETIME();
WHILE @counter < @iterations
BEGIN
-- code to time here
SET @counter = @counter + 1;
END;
SET @endTime = SYSDATETIME();
SELECT DATEDIFF(MICROSECOND,@startTime,@endTime) / @iterations
No comments:
Post a Comment