2 * Copyright (C) 2011-2012 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/>.
26 #include "timespec.h" /* gnulib gettime */
28 typedef void (*sighandler_t
)(int);
30 void benchmark_cipher (int init
, int debug_level
);
31 void benchmark_tls (int debug_level
, int ciphers
);
35 struct timespec start
;
37 sighandler_t old_handler
;
41 LARGE_INTEGER alarm_timeout
;
45 extern int benchmark_must_finish
;
47 void start_benchmark(struct benchmark_st
* st
);
48 double stop_benchmark(struct benchmark_st
* st
, const char* metric
);
50 inline static unsigned int
51 timespec_sub_ms (struct timespec
*a
, struct timespec
*b
)
53 return (a
->tv_sec
* 1000 + a
->tv_nsec
/ (1000 * 1000) -
54 (b
->tv_sec
* 1000 + b
->tv_nsec
/ (1000 * 1000)));