+ if (argc < 2) {
+ printf("Usage : %s duration (s) [-r] [-w] "
+ "(yield reader and/or writer)\n", argv[0]);
+ return -1;
+ }
+
+ err = sscanf(argv[1], "%lu", &duration);
+ if (err != 1) {
+ printf("Usage : %s duration (s) [-r] [-w] "
+ "(yield reader and/or writer)\n", argv[0]);
+ return -1;
+ }
+
+#ifdef DEBUG_YIELD
+ for (i = 2; i < argc; i++) {
+ if (argv[i][0] != '-')
+ continue;
+ switch (argv[i][1]) {
+ case 'r':
+ yield_active |= YIELD_READ;
+ break;
+ case 'w':
+ yield_active |= YIELD_WRITE;
+ break;
+ }
+ }
+#endif
+
+ printf("running test for %lu seconds.\n", duration);
+ start_time = time(NULL);