Share this page

# lr_start_timer

Starts a timer.

    merc_timer_handle_t lr_start_timer ();

Alphabetical Listing - C Language Utility Functions

## Return Values

Returns merc_timer_handle_t, a handle to a timer.

## Parameterization

Parameterization is not applicable to this function.

## Example

In the following segment, lr_start_timer and lr_end_timer calculate the time spent on checks. This is then subtracted from the time spent on transaction "sampleTrans" with lr_wasted_time.

    double time_elapsed, duration, waste;
    merc_timer_handle_t timer;
        lr_start_transaction("sampleTrans");
        web_url("index.htm",
            "URL=http://localhost/index.htm",
            "TargetFrame=",
            "Resource=0",
            "RecContentType=text/html",
            "Referer=",
            "Snapshot=t1.inf",
            "Mode=HTML",
            LAST );
        timer = lr_start_timer();

    /* Do some checks the duration of which
    is not to be included in the transaction. */

        web_image_check("ImgCheck1",
            "src=index_files/image002.jpg",
            LAST );

        web_image_check("ImgCheck2",
            "src=index_files/planets.gif",
            LAST );

    // How long did the tests take in seconds.

        time_elapsed = lr_end_timer(timer);

    // Convert to millisecond.s

        waste = time_elapsed * 1000;

    /* Remove the time the checks took from the transaction. */

        lr_wasted_time(waste);
        lr_end_transaction("sampleTrans", LR_AUTO);

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: