diff options
author | Keith Packard <keithp@keithp.com> | 2014-03-10 09:12:45 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-03-10 09:12:45 -0700 |
commit | 1999b37e12fc358aa21f8dac2d11edff43377fc0 (patch) | |
tree | f68eaf63f9ee7789081575a0814b116fe42b1fc6 | |
parent | f640487e27a3904831ff85033a2869e981e9d942 (diff) |
Add '-pause' option to delay between runs
This lets the package cool down to get more consistent performance numbers.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | x11perf.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -105,6 +105,7 @@ static const char *(visualClassNames)[] = { static Bool labels = False; static int repeat = 5; static int seconds = 5; +static int delay = 0; static Window status; /* Status window and GC */ static GC tgc; @@ -476,6 +477,7 @@ usage(void) " -pack pack rectangles right next to each other", " -repeat <n> do tests <n> times (default = 5)", " -time <s> do tests for <s> seconds each (default = 5)", +" -pause <s> pause for <s> seconds between each run", /* " -draw draw after each test -- pmax only", */ @@ -873,6 +875,8 @@ ProcessTest(XParms xp, Test *test, int func, unsigned long pm, char *label) totalTime += time; ReportTimes (time, reps * test->parms.objects, label, False); + if (delay) + sleep(delay); } if (repeat > 1) { ReportTimes(totalTime, @@ -992,6 +996,13 @@ main(int argc, char *argv[]) seconds = atoi (argv[i]); if (seconds <= 0) usage (); + } else if (strcmp (argv[i], "-pause") == 0) { + ++i; + if (argc <= i) + usage (); + delay = atoi (argv[i]); + if (delay < 0) + usage (); } else if (strcmp(argv[i], "-fg") == 0) { i++; if (argc <= i) |