MyITBlog.com - IT Professionals Online Journal
 
  Home  |   Site News  |   About Us  |   Privacy  |   FAQ  |   Contact   Add Blog Entry  |  Login  |  Register   
 My Account
Username
Password
Remember me
Lost Password?


 Categories


  HOME  >  Programming  >  TestingPrint


0
Votes
Load Runner Function - How to get current system time in Testing   
by jkodadhala on 15 Nov 2005, 05:36     Read jkodadhala's Blog
Total Hits: 992    Comments: 0   

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 given

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;

 return(current_time);
}


 

Post Comment

Copyright © 2008 MyITBlog.com