24 void Runtime::ReadArgs(int argc, const char *const *argv) {
25 if (argc <= 0) return;
31 for (int i = 1; i < argc; ++i) {
32 const char *arg = argv[i];
33 if (!arg || arg[0] == '\0') {
34 cerr << "warning: found empty argument at position " << i << endl;
37 if (options && arg[0] == '-') {
39 cerr << "warning: incomplete option list at position " << i << endl;
40 } else if (arg[1] == '-') {
46 cerr << "unknown option " << arg << endl;
51 for (int j = 1; arg[j] != '\0'; ++j) {
55 if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
56 cerr << "missing argument to -n" << endl;
59 n = strtoul(argv[i], nullptr, 10);
64 if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
65 cerr << "missing argument to -s" << endl;
68 seed = strtoul(argv[i], nullptr, 10);
73 if (i >= argc || argv[i] == nullptr || argv[i][0] == '\0') {
74 cerr << "missing argument to -t" << endl;
77 t = strtoul(argv[i], nullptr, 10);
85 cerr << "unknown option " << arg[j] << endl;
91 } else if (isdigit(arg[0])) {
92 // positional number interpreted as -n
93 n = strtoul(arg, nullptr, 10);
95 cerr << "unable to interpret argument "
96 << i << " (" << arg << ")" << endl;
108 mode = FIXED_FRAME_LIMIT;
119 int Runtime::Execute() {
124 Application app(seed);
136 case FIXED_FRAME_LIMIT: