# running

> 1. Checking components

> 2. Checking timers

> 3. Starting the profiler

### 1. Checking components

The operation is used to check whether a given parallel test component is running (i.e., has neither timed out nor been stopped). The Boolean value true is returned if the component have been started but not yet terminated or stopped, false otherwise.

- The operation does not block TTCN-3 program execution, i.e., it reflects the momentary state of the parallel test component and does not wait for its termination.
- When the all keyword is used with the operation, it will return true if all parallel test components started are executing their behavior.
- When the any keyword is used with the operation, it will return true if at least one parallel test component is executing its behavior.

Related keywords:

- alive
- all
- any
- component
- create
- @profiler

### component_reference.running;

- The component_reference is one of the following:

  - a reference returned by the create operation to refer to a given parallel test component,
  - the keyword pair all component to check whether all parallel test components are still running,

  - the keyword pair any component to check whether at least one parallel test component is still running

- The running keyword denotes that (a) component(s) should be checked.

See Examples

### 2. Checking timers

The operation is used to check whether a given timer is running (i.e., has neither timed out nor been stopped). The Boolean value true is returned if the timer is running, false otherwise.

- The operation does not block TTCN-3 program execution, i.e., it reflects the momentarily state of the timer and does not wait for timeout.
- The keyword any may be used to check whether at least one timer is running.

Related keywords:

- any
- read
- start
- stop
- timer
- timeout

### ( timer_identifier | any timer ).running ;

- timer_identifier is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.

It is possible to check a member of a timer array.

See Example 1c

### timer_identifier[array_index].running;

- timer_identifier is the name used to refer to the timer. It must begin with a letter, may contain letters, numbers and underscore characters.

- array_index points out the timer to be checked.

### Examples

Example 1a:

var boolean v_Tbana := vc_metro.running;

The variable v_Tbana gets the value true if the component with the reference vc_metro is running.

Example 1b:

var boolean v_Ubahn := all component.running;

The variable v_Ubahn will true if all started parallel components are still running.

Example 1c

var boolean v_metropolitain := any component.running;

The variable v_metropolitain is true if at least one parallel component is still running.

Example 2a:

var boolean v_coureur := T_hledat.running;

The variable v_coureur gets the value true if the global timer T_hledat is running.

Example 2b:

var boolean v_forlasu := any timer.running;

The variable v_forlasu is true if at least one timer is running in the scope unit where the command have been issued.

Example 2c:

var boolean v_medlem := Tl_Odeon[3].running;

The variable v_medlem will true if the fourth timer of the array Tl_Odeon is still running.

BNF definition of component running

BNF definition of timer runnnig