Share this page

# lr_end_timer

Stops a timer.

    double lr_end_timer (merc_timer_handle_t timer);

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
timer | The handle of the timer returned by lr_start_timer.

lr_end_timer stops a timer that began timing when lr_start_timer was called. It returns the elapsed time. The resolution depends on the runtime environment. The maximum resolution is a microsecond.

## Return Values

The function returns the elapsed time in seconds. In Java, the function returns the elapsed time in milliseconds.

## Parameterization

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

## Example

In the following segment, lr_start_timer and lr_end_timer calculate the time spent on the call to web_reg_save_param. This is then subtracted from the time spent on transaction "Web-tours" with lr_wasted_time.

Copy code

    double time_elapsed;
    merc_timer_handle_t timer;
    lr_start_transaction ("Web-tours");
    web_url("home;sz=234x60;tile=1;ord=977672495775323400",
        "URL=http://ad.doubleclick.net/...ord=977672495775323400",
         ..
        "Mode=URL",
        LAST );
    timer = lr_start_timer();
    web_reg_save_param("WCSParam_Diff1", "LB=http://", "RB=/", "Ord=17", "Search=body", LAST );

    /* result is in seconds */
    time_elapsed = lr_end_timer(timer);
    lr_output_message("Duration of web_reg_save_param = %lf", time_elapsed);

    /* Subtract time spent on call web_reg_save_param from all open transactions.
    Wasted time is measured in milliseconds */
    lr_wasted_time(1000 * time_elapsed);

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