2 * Copyright (C) 2011-2022 Free Software Foundation, Inc.
4 * This file is part of GnuTLS.
6 * GnuTLS is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GnuTLS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 # include <sys/time.h>
30 # include "timespec.h" /* gnulib gettime */
32 typedef void (*sighandler_t) (int);
36 struct timespec start;
38 sighandler_t old_handler;
42 LARGE_INTEGER alarm_timeout;
46 extern int benchmark_must_finish;
48 void start_benchmark (struct benchmark_st *st);
49 double stop_benchmark (struct benchmark_st *st, const char *metric);
51 inline static unsigned int
52 timespec_sub_ms (struct timespec *a, struct timespec *b)
54 return (a->tv_sec * 1000 + a->tv_nsec / (1000 * 1000) -
55 (b->tv_sec * 1000 + b->tv_nsec / (1000 * 1000)));
58 #endif /* BENCHMARK_H */