summaryrefslogtreecommitdiff
path: root/src/benchmark.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/benchmark.h')
-rw-r--r--src/benchmark.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/benchmark.h b/src/benchmark.h
index fe52100..a451db4 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2011-2022 Free Software Foundation, Inc.
*
* This file is part of GnuTLS.
*
@@ -17,31 +17,30 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <config.h>
-#include <sys/time.h>
-#include <time.h>
-#include <signal.h>
-#if defined _WIN32
-#include <windows.h>
-#endif
-#include <time.h>
+#ifndef BENCHMARK_H
+# define BENCHMARK_H
+
+# include <sys/time.h>
+# include <time.h>
+# include <signal.h>
+# if defined _WIN32
+# include <windows.h>
+# endif
+# include <time.h>
+# include "timespec.h" /* gnulib gettime */
typedef void (*sighandler_t) (int);
struct benchmark_st
{
-#ifdef HAVE_CLOCK_GETTIME
struct timespec start;
-#else
- struct timeval start;
-#endif
unsigned long size;
sighandler_t old_handler;
-#if defined _WIN32
+# if defined _WIN32
HANDLE wtimer;
HANDLE wthread;
LARGE_INTEGER alarm_timeout;
-#endif
+# endif
};
extern int benchmark_must_finish;
@@ -55,3 +54,5 @@ timespec_sub_ms (struct timespec *a, struct timespec *b)
return (a->tv_sec * 1000 + a->tv_nsec / (1000 * 1000) -
(b->tv_sec * 1000 + b->tv_nsec / (1000 * 1000)));
}
+
+#endif /* BENCHMARK_H */