From: stevenj Date: Tue, 15 Nov 2011 23:07:34 +0000 (-0500) Subject: bug in timer, thanks to William Vaughn for the patch X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c4b864ccd2a51fcb547a0dde27c261172b564474;p=nlopt.git bug in timer, thanks to William Vaughn for the patch Ignore-this: 80c91b13714b274d94f7a14bc2792a0 darcs-hash:20111115230734-c8de0-b84fa13e892b3f30f272ff2fd552aca2e5207151.gz --- diff --git a/util/timer.c b/util/timer.c index 7762b2b..99fa344 100644 --- a/util/timer.c +++ b/util/timer.c @@ -49,7 +49,7 @@ double nlopt_seconds(void) gettimeofday(&start, NULL); } gettimeofday(&tv, NULL); - return (tv.tv_sec - start.tv_sec) + 1.e-6 * (tv.tv_usec - start.tv_sec); + return (tv.tv_sec - start.tv_sec) + 1.e-6 * (tv.tv_usec - start.tv_usec); #elif defined(HAVE_TIME) return time(NULL); #elif defined(_WIN32) || defined(__WIN32__)