Simple Loop to Introduce a Delay in TI

Ideas and tips for enhancing your TM1 application
Post Reply
User avatar
Steve Rowe
Site Admin
Posts: 1688
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: 10.2.2., PAW
Excel Version: Nearly all of them

Simple Loop to Introduce a Delay in TI

Post by Steve Rowe » Fri Aug 28, 2009 1:17 pm

Just a simple TI snippet to introduce a delay into a TI.
On my hardware mxInternalLoop=1250000 gives a delay of 1 second, so setting mxLoop=30 gives a 30 second delay.
I needed to use this when using ExecuteCommand to copy a large file, see this thread.

Note that I had to move mxLoop out to 60 to get a satisfactory delay that ensured that the server had finished doing whatever it was doing that was stuffing everything up.

Code: Select all

#Vary this to give length
mxLoop=30;

ixInternalLoop=1;
ixLoop=1;
mxInternalLoop=1250000;

While(ixLoop<=mxLoop);
   ixLoop=ixLoop+1;
   ixInternalLoop=1;
   While (ixInternalLoop<=mxInternalLoop);
       ixInternalLoop=   ixInternalLoop+1;
    End; 
End;

Post Reply