' Copyright (c) Microsoft Corporation. All rights reserved.PublicSubLongTask(ByValDurationAsSingle,_ByValMinimumIntervalAsSingle)DimThresholdAsSingleDimStartAsSingleDimblnCancelAsBoolean' The Timer property of the DateAndTime object returns the seconds' and milliseconds that have passed since midnight.Start=CSng(Timer)Threshold=MinimumIntervalDoWhileCSng(Timer)<(Start+Duration)' In a real application, some unit of work would' be done here each time through the loop.IfCSng(Timer)>(Start+Threshold)ThenRaiseEventPercentDone(_Threshold/Duration,blnCancel)' Check to see if the operation was canceled.IfblnCancelThenExitSubThreshold=Threshold+MinimumIntervalEndIfLoopEndSub