]> code.citadel.org Git - citadel.git/blobdiff - citadel/utils/loadtest.c
Remove preprocessor tests for OpenSSL. It's a requirement.
[citadel.git] / citadel / utils / loadtest.c
index 0c3924c2212fa5a203a12b2a09f633db52072643..0f2285d4ba26a9bca3df8bdab67ac9993db03aa2 100644 (file)
@@ -313,8 +313,8 @@ void *loadtest(void *pointer_to_thread_id) {
                perform_random_thing(serv_sock);
                printf("\033[%d;%dH\033[32m%8ld\033[0m", row, col, ++ops);
                ++ops_completed;                // this is declared "volatile" so we don't need to lock it
-               if (thread_id == 0) {
-                       printf("\033[2;55H\033[44m\033[33m\033[1m%d ops/sec \033[0m", (ops_completed / (time(NULL) - time_started)));
+               if ( (thread_id == 0) && (time(NULL) > time_started) ) {
+                       printf("\033[2;55H\033[44m\033[33m\033[1m%ld ops/sec \033[0m", (ops_completed / (time(NULL) - time_started)));
                }
                fflush(stdout);
        }
@@ -350,7 +350,7 @@ void setup_accounts(int serv_sock) {
 // Main loop.  Do things and have fun.
 int main(int argc, char **argv) {
        int i;
-       int nthreads = 3;
+       int nthreads = 10;
        int row, col;
 
        fprintf(stderr, "\033[2J\033[H\033[44m\033[1m"