axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/tests/client/performance/time Client.cpp
Date Fri, 19 Nov 2004 09:10:06 GMT
samisa      2004/11/19 01:10:06

  Modified:    c/tests/client/performance/time Client.cpp
  Log:
  Updated code to use memset for initing array to send.
  
  Revision  Changes    Path
  1.7       +14 -5     ws-axis/c/tests/client/performance/time/Client.cpp
  
  Index: Client.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/client/performance/time/Client.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Client.cpp	19 Nov 2004 08:54:04 -0000	1.6
  +++ Client.cpp	19 Nov 2004 09:10:06 -0000	1.7
  @@ -86,13 +86,20 @@
   
   	InteropTestPortType ws (endpoint);
   
  -        ws.setTransportTimeout(2);
  +        //ws.setTransportTimeout(2);
   
           // Prepare the string to be sent 
  -        char* buffer = new char[ length * strlen(STRING_TO_SEND) + 1];
  -        buffer[0] = '\0';
  -        for (int i = 0; i < length; i++ )
  -            strcat(buffer, STRING_TO_SEND);
  +        char* buffer = new char[ length + 1];
  +        char c = 'A';
  +        memset(buffer, c, length);
  +        buffer[length] = '\0';
  +        
  +        //printf("%s\n", buffer);
  +
  +        //char* buffer = new char[ length * strlen(STRING_TO_SEND) + 1];
  +        //buffer[0] = '\0';
  +        //for (int i = 0; i < length; i++ )
  +        //    strcat(buffer, STRING_TO_SEND);
   	
   	// Time mesurement stuff
   	time_t startTime;
  @@ -101,6 +108,8 @@
   	time( &startTime );
   
           char* echoStringResult = ws.echoString(buffer);
  +
  +        //printf("%s\n", echoStringResult);
   
   	time( &endTime );
           printf( "Time spent to invoke method ws.echoString(buffer); = %lf s\n", difftime(
endTime, startTime ) );
  
  
  

Mime
View raw message