Share this page

# Example: lr.peek_events

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 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: