PRB: SQL Server Books Online Incorrectly States the Type of Result Set for @@CPU_BUSY, @@IO_BUSY and @@IDLE Functions Is Milliseconds Instead of Ticks (813199)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 7.0

SYMPTOMS

The Transact-SQL Reference topic in SQL Server Books Online incorrectly states that the following functions return the time in milliseconds instead of ticks:
  • @@CPU_BUSY
  • @@IO_BUSY
  • @@IDLE

The results for the @@CPU_BUSY, @@IO_BUSY, and @@IDLE functions are actually returned in ticks. Each tick is 32 milliseconds, or one thirty-second of a second of the computer. An example for the function @@CPU_BUSY is:
SELECT @@CPU_BUSY AS 'CPU ms', GETDATE() AS 'As of'
The result set is:
CPU ms            As of 
----------------- --------------------------- 
20 		  1998-04-18 14:43:08.180  

The result of 20 is not in milliseconds.

WORKAROUND

To work around and calculate the actual time in milliseconds, you must multiply the result value by 32. In this case, 20 ticks times 32 milliseconds (20 * 32) = 640 milliseconds.

STATUS

Microsoft has confirmed that this is a problem in Books Online of the Microsoft products that are listed at beginning of this article.

MORE INFORMATION

The time per tick is computer dependent. Each tick on the operating system is 32 milliseconds, or one thirty-second of a second. To compute the value of a tick, you must run the following code in SQL Query Analyzer:
 SELECT @@TIMETICKS

REFERENCES

For more information about how to get the statistics for Microsoft SQL Server, see the sp_monitor topic in SQL Server Books Online.

Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbprb kbOnlineDocs kbdocerr KB813199 kbAudDeveloper kbAudITPRO