* stress.c: Wait before posting instead of after posting.
authorMichael Hampton <io_error@uncensored.citadel.org>
Sun, 21 Mar 2004 22:35:20 +0000 (22:35 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Sun, 21 Mar 2004 22:35:20 +0000 (22:35 +0000)
citadel/ChangeLog
citadel/stress.c

index 94b564eb6df2a177a990be3409a280b06d4be754..df2e330136dbfa7eaf1e28fb32a9378444d76843 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 614.92  2004/03/21 22:35:20  error
+ * stress.c: Wait before posting instead of after posting.
+
  Revision 614.91  2004/03/21 22:34:41  error
  * database_sleepycat.c: emit a panic message when Berkeley DB wants us to
    run recovery; should provide a little more detail on the actual error
@@ -5574,3 +5577,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index f602b711db1ce7bede0c0662718b910fd595f445..ba141d0b91dabb6848ab021601daf8183cd1e457 100644 (file)
@@ -197,6 +197,9 @@ void* worker(void* data)
                struct timeval tv;
                long tstart, tend;
 
+               /* Wait for a while */
+               sleep(w);
+
                gettimeofday(&tv, NULL);
                tstart = tv.tv_sec * 1000 + tv.tv_usec / 1000; /* cvt to msec */
                /* Select the room to goto */
@@ -238,24 +241,19 @@ void* worker(void* data)
                        return NULL;
                }
 
-               if (w >= 3) {
-                       /* Do a status update */
-                       pthread_mutex_lock(&count_mutex);
-                       count++;
-                       pthread_mutex_unlock(&count_mutex);
-                       fprintf(stderr, "%d of %d - %d%%        \r",
-                               count, total,
-                               (int)(100 * count / total));
-               }
+               /* Do a status update */
+               pthread_mutex_lock(&count_mutex);
+               count++;
+               pthread_mutex_unlock(&count_mutex);
+               fprintf(stderr, "%d of %d - %d%%        \r",
+                       count, total,
+                       (int)(100 * count / total));
                gettimeofday(&tv, NULL);
                tend = tv.tv_sec * 1000 + tv.tv_usec / 1000; /* cvt to msec */
                tend -= tstart;
                if (tend < tmin) tmin = tend;
                if (tend > tmax) tmax = tend;
                trun += tend;
-
-               /* Wait for a while */
-               sleep(w);
        }
        end = time(NULL);
        pthread_mutex_lock(&output_mutex);