Fix bug in recent syscall_timing change: measure the number of iterations

each loop, rather than once up front.  The distinction is unimportant
when doing a fix iteration count, but when using a timer, it should vary.

Sponsored by:	Google, Inc.
MFC after:	2 weeks
This commit is contained in:
Robert Watson 2010-10-21 17:35:08 +00:00
parent 1a587ef2a5
commit 3e36aa656e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214145

View File

@ -671,11 +671,12 @@ main(int argc, char *argv[])
/*
* Run one warmup, then do the real thing (loops) times.
*/
calls = the_test->t_func(iterations, the_test->t_int,
the_test->t_func(iterations, the_test->t_int,
the_test->t_string);
calls = 0;
for (k = 0; k < loops; k++) {
the_test->t_func(iterations, the_test->t_int,
the_test->t_string);
calls = the_test->t_func(iterations,
the_test->t_int, the_test->t_string);
timespecsub(&ts_end, &ts_start);
printf("%s\t%d\t", the_test->t_name, k);
printf("%ju.%09ju\t%d\t", (uintmax_t)ts_end.tv_sec,