httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/support ab.c
Date Thu, 04 Jul 2002 22:56:51 GMT
brianp      2002/07/04 15:56:51

  Modified:    support  ab.c
  Log:
  use the time conversion macros rather than dividing by APR_USEC_PER_SEC
  
  Revision  Changes    Path
  1.106     +11 -9     httpd-2.0/support/ab.c
  
  Index: ab.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/support/ab.c,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- ab.c	31 May 2002 21:33:24 -0000	1.105
  +++ ab.c	4 Jul 2002 22:56:51 -0000	1.106
  @@ -301,7 +301,7 @@
   char url[1024];
   char * fullurl, * colonhost;
   int isproxy = 0;
  -apr_short_interval_time_t aprtimeout = 30 * APR_USEC_PER_SEC;	/* timeout value */
  +apr_interval_time_t aprtimeout = apr_time_from_sec(30);	/* timeout value */
    /*
     * XXX - this is now a per read/write transact type of value
     */
  @@ -658,7 +658,7 @@
               case SSL_ERROR_WANT_WRITE:
               case SSL_ERROR_WANT_CONNECT:
                   BIO_printf(bio_err, "Waiting .. sleep(1)\n");
  -                apr_sleep(1 * APR_USEC_PER_SEC);
  +                apr_sleep(apr_time_from_sec(1));
                   c->state = STATE_CONNECTING;
                   c->rwrite = 0;
                   break;
  @@ -827,7 +827,8 @@
   
       endtime = apr_time_now();
       timetakenusec = endtime - start;
  -    timetaken = (float) timetakenusec / APR_USEC_PER_SEC;
  +    timetaken = ((float)apr_time_sec(timetakenusec)) +
  +        ((float)apr_time_usec(timetakenusec)) / 1000000.0;
       
       printf("\n\n");
       printf("Server Software:        %s\n", servername);
  @@ -839,8 +840,8 @@
       printf("\n");
       printf("Concurrency Level:      %d\n", concurrency);
       printf("Time taken for tests:   %ld.%03ld seconds\n",
  -           (long) (timetakenusec / APR_USEC_PER_SEC),
  -           (long) (timetakenusec % APR_USEC_PER_SEC));
  +           (long) apr_time_sec(timetakenusec),
  +           (long) apr_time_usec(timetakenusec));
       printf("Complete requests:      %ld\n", done);
       printf("Failed requests:        %ld\n", bad);
       if (bad)
  @@ -1100,7 +1101,8 @@
   	   trstring, tdstring, tdstring, concurrency);
       printf("<tr %s><th colspan=2 %s>Time taken for tests:</th>"
   	   "<td colspan=2 %s>%qd.%03qd seconds</td></tr>\n",
  -	   trstring, tdstring, tdstring, timetaken / APR_USEC_PER_SEC, timetaken % APR_USEC_PER_SEC);
  +	   trstring, tdstring, tdstring, (long long)apr_time_sec(timetaken),
  +           (long long)apr_time_usec(timetaken));
       printf("<tr %s><th colspan=2 %s>Complete requests:</th>"
   	   "<td colspan=2 %s>%ld</td></tr>\n",
   	   trstring, tdstring, tdstring, done);
  @@ -1635,7 +1637,7 @@
   
   	/* check for time limit expiry */
   	now = apr_time_now();
  -	timed = (apr_int32_t)((now - start) / APR_USEC_PER_SEC);
  +	timed = (apr_int32_t)apr_time_sec(now - start);
   	if (tlimit && timed > (tlimit * 1000)) {
   	    requests = done;	/* so stats are correct */
   	}
  
  
  

Mime
View raw message