Example: lr_start_timer

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;
        LAST );
    timer = lr_start_timer();
/* Do some checks the duration of which 
is not to be included in the transaction. */
        LAST );
        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_end_transaction("sampleTrans", LR_AUTO);