Topic Path: Symbol Reference > Classes > TIdAntiFreezeBase Class > TIdAntiFreezeBase Methods > Sleep Method
TIdAntiFreezeBase.Sleep Method

Yields processor cycles and optionally processes application messages.

class procedure Sleep(
    ATimeout: Integer
Total milliseconds to yiled to the application. 

Sleep is a class procedure that forces a TIdAntiFreezeBase descendant to yield processor cycles for the number of milliseconds specified in ATimeout. 

Sleep calls ShouldUse to determine if a TIdAntiFreezeBase descendant is in use in the application. When ShouldUse is True, Sleep calls Sleep (in IdCoreGlobal.pas) and DoProcess repeatedly until ATimeout milliseconds have elapsed. Each iteration allows Sleep to pause the application for IdleTimeOut milliseconds, and calls DoProcess to allow the main thread of excution to handle application messages. 

When ShouldUse is False, Sleep calls Sleep for ATimeout milliseconds with no additional processing.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.