svn rev #23142: trunk/src/tests/threads/
raeburn@MIT.EDU
raeburn at MIT.EDU
Fri Nov 6 19:14:37 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=23142
Commit By: raeburn
Log Message:
Don't flush stdout so much. Calculate and display some more averages.
Changed Files:
U trunk/src/tests/threads/t_rcache.c
Modified: trunk/src/tests/threads/t_rcache.c
===================================================================
--- trunk/src/tests/threads/t_rcache.c 2009-11-07 00:14:33 UTC (rev 23141)
+++ trunk/src/tests/threads/t_rcache.c 2009-11-07 00:14:37 UTC (rev 23142)
@@ -120,8 +120,10 @@
t.now = time(0);
try_one(&t);
t.total++;
-/* printf("%c", chr); */
+#if 0
+ printf("%c", chr);
fflush(stdout);
+#endif
}
/* printf("thread %u total %u\n", (unsigned) ((int *)x-ip), t.total);*/
*(int*)x = t.total;
@@ -172,6 +174,7 @@
{
krb5_error_code err;
int i;
+ unsigned long sum;
process_options (argc, argv);
err = krb5_init_context(&ctx);
@@ -237,9 +240,15 @@
}
while (time(0) < end_time + 1)
sleep(1);
- for (i = 0; i < n_threads; i++)
+ sum = 0;
+ for (i = 0; i < n_threads; i++) {
+ sum += ip[i];
printf("thread %d total %5d, about %.1f per second\n", i, ip[i],
((double) ip[i])/interval);
+ }
+ printf("total %lu in %d seconds, avg ~%.1f/sec, ~%.1f/sec/thread\n",
+ sum, interval,
+ ((double)sum)/interval, ((double)sum)/interval/n_threads);
free(ip);
if (init_once)
More information about the cvs-krb5
mailing list