char *progname = NULL;
char *version = "1.1";
-int nb = 1000;
+double abe_per = 0;
int do_stat = 0;
+int excl_first = 0;
int hist_bin = 10;
+int nb = 1000;
char *output = NULL;
extern char *message;
{
FILE *fd = ret ? stderr : stdout;
fprintf (fd, "usage: %s [-b int] [-h] [-n int] [-o file] [-s]\n", progname);
+ fprintf (fd, " -a: avoid aberrand valies (%g%%)\n", abe_per);
fprintf (fd, " -b: nb bins for histogram (%d)\n", hist_bin);
+ fprintf (fd, " -e: exclude %d first tests\n", excl_first);
fprintf (fd, " -h: help message\n");
fprintf (fd, " -n: nb measurements (%d)\n", nb);
fprintf (fd, " -o: output raw data (%s)\n", (output) ? output : "none");
}
char c = arg[1];
switch (c) {
+ case 'a':
+ arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
+ if (arg == NULL) {
+ fprintf (stderr, "%s: no aberrant percent specified\n", progname);
+ return usage (1);
+ }
+ abe_per = strtod (arg, NULL);
+ break;
case 'b':
arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
if (arg == NULL) {
}
hist_bin = atoi (arg);
break;
+ case 'e':
+ arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
+ if (arg == NULL) {
+ fprintf (stderr, "%s: no number of first to exclude specified\n", progname);
+ return usage (1);
+ }
+ excl_first = atoi (arg);
+ break;
case 'n':
arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
if (arg == NULL) {
}
if (do_stat) {
+
+ if (excl_first) {
+ for (int i = 0; i < nb - excl_first; i++) {
+ buffer[i] = buffer[i + excl_first];
+ }
+ nb -= excl_first;
+ }
+
+ if (abe_per != 0) {
+ for (int j = 1; j < nb - 1; j++) {
+ int change_done = 0;
+ for (int i = 1; i < nb - 1; i++) {
+ if (buffer[i + 1] < buffer[i]) {
+ int64_t tmp = buffer[i];
+ buffer[i] = buffer[i + 1];
+ buffer[i + 1] = tmp;
+ change_done = 1;
+ }
+ }
+ if (!change_done) {
+ break;
+ }
+ }
+ int n = nb * abe_per / 100;
+ for (int i = 0; i < nb - n; i++) {
+ buffer[i] = buffer[i - n / 2];
+ }
+ nb -= n;
+ }
+
char unit[32] = { 0 };
switch (sec_unit) {
case sec_e : strcpy (unit, "second"); break;