Printer FriendlyEmail Article Link

TTworkbench: How to set timers in TTCN-3? Can I change it dynamically?

Environment/Versions
TTworkbench, Windows, Linux, 32/64bit
Answer
The timer is set in TTCN-3 as below.
var timer myTimer := 1.0; // one second, float value with second as unit
myTimer.start();

or
myTimer.start(newTimerValue);  // newTimerValue overwrites myTimer value

You can change the value dynamically by using start statement again. If the timer is still running it will be automatically stopped and started again with the new value.

A timeout is caught in an alt block
alt {
...
[] myTimer.timeout{ ... }
}

More information about timer you will find in the TTCN-3 Standard chapter "Timer operations".

Product : TTCN-3 Language