Skip to content

Commit

Permalink
setup tests.c for benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
siv2r committed Jan 11, 2022
1 parent a1102b1 commit 4c4de09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "../include/secp256k1_preallocated.h"
#include "testrand_impl.h"
#include "util.h"
#include "bench.h"

#include "../contrib/lax_der_parsing.c"
#include "../contrib/lax_der_privatekey_parsing.c"
Expand Down Expand Up @@ -6784,6 +6785,10 @@ void run_cmov_tests(void) {
}

int main(int argc, char **argv) {
/* setup and start the timer */
uint64_t begin, end;
begin = gettime_i64();

/* Disable buffering for stdout to improve reliability of getting
* diagnostic information. Happens right at the start of main because
* setbuf must be used before any other operation on the stream. */
Expand Down Expand Up @@ -6909,5 +6914,9 @@ int main(int argc, char **argv) {
secp256k1_context_destroy(ctx);

printf("no problems found\n");

/* end timer */
end = gettime_i64() - begin;
printf("Execution Time (us): %ld\n", end);
return 0;
}

0 comments on commit 4c4de09

Please sign in to comment.