Skip to content

Commit

Permalink
use time() instead of clock() (FIXME: what to do for non-POSIX system…
Browse files Browse the repository at this point in the history
…s?) ...thanks to JP Sugarbroad and James A. Treacy for the bug report
  • Loading branch information
stevengj committed Jul 28, 2003
1 parent 9de4044 commit 443c1d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/fftw-wisdom.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int bench_main(int argc, char *argv[])
char *output_fname = 0;
bench_problem **problems = 0;
int nproblems = 0, iproblem = 0;
clock_t begin;
time_t begin;

verbose = 0;
usewisdom = 0;
Expand Down Expand Up @@ -321,18 +321,18 @@ int bench_main(int argc, char *argv[])
nproblems = iproblem;
qsort(problems, nproblems, sizeof(bench_problem *), prob_size_cmp);

begin = clock();
begin = time((time_t*)0);
for (iproblem = 0; iproblem < nproblems; ++iproblem) {
if (hours <= 0
|| hours > (clock() - begin) / 3600.0 / CLOCKS_PER_SEC)
|| hours > (time((time_t*)0) - begin) / 3600.0)
do_problem(problems[iproblem]);
problem_destroy(problems[iproblem]);

}
free(problems);

if (verbose && hours > 0
&& hours < (clock() - begin) / 3600.0 / CLOCKS_PER_SEC)
&& hours < (time((time_t*)0) - begin) / 3600.0)
fprintf(stderr, "EXCEEDED TIME LIMIT OF %g HOURS.\n", hours);

if (!output_fname)
Expand Down

0 comments on commit 443c1d7

Please sign in to comment.