Share this page

# lr.startTimer

Starts a timer.

Example | Informational Functions

## Syntax

    lr.startTimer ();

lr.startTimer starts a timer that calculates the passage of time in seconds.

lr.startTimer returns a handle to the timer. Pass the handle to lr.endTimer to stop the timer.

## Return Values

Returns merc_timer_handle_t, a handle to a timer.

## Parameterization

Parameterization is not applicable to this function.

## Example

    function Action(){

       var timer = lr.startTimer();

       /* result is in seconds */
       var timeElapsed = lr.endTimer(timer);

       lr.outputMessage("Duration = " + timeElapsed);

       /* Subtract time spent on call web_reg_save_param from all open transactions.
       Wasted time is measured in milliseconds */

       lr.wastedTime(1000 * timeElapsed);
    return 0;
    }

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: