Advertisement
easternnl

LoadRunner: Time-out in while function

Oct 31st, 2016
3,408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Action()
  2. {
  3.    
  4.     // add: #include <time.h> to globals.h
  5.    
  6.  
  7.     time_t current_time;
  8.     time_t stop_time;
  9.    
  10.     /* Obtain current time. */
  11.     current_time = time(NULL);
  12.     // wait 10 seconds
  13.     stop_time = current_time+10;
  14.    
  15.     lr_log_message("Init: Current time is %d", current_time);
  16.     lr_log_message("Init: Stop time is %d", stop_time);
  17.    
  18.     while (current_time < stop_time)
  19.     {
  20.         lr_log_message("Current time is %d", current_time);
  21.        
  22.         lr_think_time(.25);
  23.        
  24.         current_time = time(NULL);
  25.     }
  26.    
  27.    
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement