Utility Functions and C Language Reference > Utility Functions: C Language (lr_) > Wasted Time

Wasted Time

Wasted time is time spent on activities whose purpose is to support test analysis, but would never be performed by a browser user, for example, time spent keeping transaction statistics for later reporting. Wasted time is calculated internally. Your script can also add wasted time with lr_wasted_time.

Sometimes, you may enter activities in a script that your do not want reported as part of the transaction statistics. Generally, these are activities related to record keeping or custom analysis. If you enhance the script with steps whose durations should not be included in the test statistics, you can track the time used by these steps with lr_start_timer and lr_end_timer. Then, the function lr_wasted_time is used for adding this user-determined time to the internally generated wasted time.

You can retrieve the total wasted time (both that generated automatically and that added with lr_wasted_time) with the function lr_get_transaction_wasted_time, or with lr_get_trans_instance_wasted_time, as appropriate.

In the on-line graphs in the LoadRunner Controller and the transaction response time graphs in the LoadRunner Analysis, the transaction times are reported after subtracting the wasted time.

The time used writing the VuGen log file and the Vuser log files is not included in the wasted time. The logging time is added to the actual elapsed transaction. The lr_get_transaction_duration function returns the actual elapsed transaction time. This information may be useful in analyzing and developing test scripts.

Caution: Using extended logging may inflate transaction times. We recommend that you use extended logging only while developing scripts, and not in actual load testing.