Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
This is because the syntax of the add method is that the second parameter would be a string referencing the unit and procedure to be executed as the timer.
Change your line of code to:
I'm not sure, though, if timers are what you want to use in this case, it depends somewhat on what's in method being called. Timers are intended to execute a particular method at specified intervals. In the code above, then, you'll execute the Unit1.abc routine once every 20 seconds. This timer will run every twenty seconds no matter what test is being run or whatever until either the timer is disabled or it is deleted.
The only other way that I know of to do what you want is to put particular time loops within your test routines (using "while" loops) to detect how long something is taking and, if it takes longer than a specified period of time, to exit out of the test.
Change your line of code to:
var test = Utils["Timers"]["Add"](20000, "Unit1.abc", true);
I'm not sure, though, if timers are what you want to use in this case, it depends somewhat on what's in method being called. Timers are intended to execute a particular method at specified intervals. In the code above, then, you'll execute the Unit1.abc routine once every 20 seconds. This timer will run every twenty seconds no matter what test is being run or whatever until either the timer is disabled or it is deleted.
The only other way that I know of to do what you want is to put particular time loops within your test routines (using "while" loops) to detect how long something is taking and, if it takes longer than a specified period of time, to exit out of the test.