Mercury Loadrunner Logo

Mercury Loadrunner  Logo

Thursday, February 26, 2009

Load Runner Functions - How to get Current System time?

This function is developed to usein Mercury Load Runner peformance tool. This main use of this functions to return the current system time at any point of time while load runner script is running.This functiona can be used to report transaction times , script starti time and end time.

long get_secs_since_midnight(void)

char * curr_hr; /* pointer to a parameter with current clock hr */

char * curr_min; /* pointer to a parameter with current clock min*/

char * curr_sec; /* pointer to a parameter with current clock sec */

long current_time, /* current number of seconds since midnight */

hr_secs, /* current hour converted to secs */

min_secs, /* current minutes converted to secs */

secs_secs; /* current number of seconds */
curr_hr = lr_eval_string("{current_hr}>");

curr_min = lr_eval_string("{current_min}");

curr_sec = lr_eval_string("{current_sec}");
hr_secs = (atoi(curr_hr)) * 60 * 60;

min_secs = (atoi(curr_min)) * 60;

secs_secs = atoi(curr_sec);

current_time = hr_secs + min_secs + secs_secs;


No comments:

Post a Comment