7 #ifndef SECP256K1_BENCH_H
8 #define SECP256K1_BENCH_H
15 static double gettimedouble(
void) {
17 gettimeofday(&tv, NULL);
18 return tv.tv_usec * 0.000001 + tv.tv_sec;
27 while (y > 0 && y < 100.0) {
34 void run_benchmark(
char *
name,
void (*benchmark)(
void*),
void (*setup)(
void*),
void (*teardown)(
void*),
void* data,
int count,
int iter) {
36 double min = HUGE_VAL;
39 for (i = 0; i < count; i++) {
44 begin = gettimedouble();
46 total = gettimedouble() - begin;
47 if (teardown != NULL) {
68 char** argm = argv + argc;
73 while (argv != NULL && argv != argm) {
74 if (strcmp(*argv, flag) == 0) {