To run a code segment for a set period of time, you can use Silk Performer's GetCurrentTime function to create a "while" loop to execute that segment for the desired period of time. The following code sample shows how GetCurrentTime is employed to execute code for a 10 minute period. transaction TMain var iCurrentTime : number; //variable n : number; //variable begin iCurrentTime := GetCurrentTime(); // gets current time, in seconds n := iCurrentTime + 600; //where "600" is 600 seconds while iCurrentTime do //start of code segment to be executed repeatedly //****your code**** iCurrentTime := GetCurrentTime(); end; //end of specific code segment end TMain; GetCurrentTime retrieves the current time, in seconds, and by setting "n := iTCurrenTime + additional simulation time", you"ll be able to run the while statement until the desired script execution period is met. Old KB# 17301
↧