Sleep is a public class procedure that forces a
TIdAntiFreezeBase descendant to yield processor cycles for as many as ATimeout milliseconds. Sleep calls
ShouldUse to determine if a
TIdAntiFreezeBase descendant is in use in the application. When
ShouldUse is True, Sleep calls IdGlobal.Sleep and
DoProcess repeatedly until ATimeout milliseconds has elapsed. Each iteration allows IdGlobal.Sleep to pause the application for TIdAntiFreeze.
IdleTimeOut milliseconds, and calls
DoProcess to allow the main thread of excution to handle application messages.
When ShouldUse is False, Sleep calls IdGlobal.Sleep for ATimeout milliseconds with no additional processing.