Share this page

# lr.peek_events

Checks for events.

    void lr.peek_events( );

The lr.peek_events function suspends the Vuser script run and checks for events before resuming.

- Scripts written in C language perform this check internally. Therefore, there is no need to use the lr.peek_events function.

- Scripts written in Java do not perform this check internally. Therefore, insert this function into your Vuser script at the point at which you want the Vuser to pause.

## Return Values

No value is returned.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## Example

In the following example, lr.peek_events enables the Vuser to pause at the start of each iteration. Pause events that occur during an iteration are effective only at the beginning of the next iteration.

        /* This example is meant to be run in iterations. */

        /* check for events */

        lr.output_message("About to check for events. Pauses can be intercepted.");
        lr.peek_events();
        lr.output_message("Finished checking for events/pauses.");
        lr.start_transaction("trans1");

        /* implement your logic here */

        lr.think_time(10);
        lr.output_message("Running test steps...");
        lr.end_transaction("trans1",lr.AUTO);
        return 0;
        }

    Example: The Replay Log below shows the use of iterations.

    Running Vuser...
    Starting iteration 1.
    Starting action Action.
    Action.c(7): About to check for events. Pauses can be intercepted now.
    Action.c(9): Finished checking for events/pauses.
    Action.c(13): Running test steps...
    Ending action Action.
    Ending iteration 1.
    Starting iteration 2.
    Starting action Action.
    Action.c(7): About to check for events. Pauses can be intercepted now.
    Action.c(9): Finished checking for events/pauses.
    Action.c(13): Running test steps...
    Ending action Action.
    Ending iteration 2.
    Ending Vuser...
    Starting action vuser_end.
    Ending action vuser_end.
    Vuser Terminated.

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: