File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 77#ifndef SECP256K1_BENCH_H
88#define SECP256K1_BENCH_H
99
10+ #include <stdlib.h>
1011#include <stdint.h>
1112#include <stdio.h>
1213#include <string.h>
13- #include "sys/time.h"
14+
15+ #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
16+ # include <time.h>
17+ #else
18+ # include "sys/time.h"
19+ #endif
1420
1521static int64_t gettime_i64 (void ) {
22+ #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
23+ /* C11 way to get wallclock time */
24+ struct timespec tv ;
25+ if (!timespec_get (& tv , TIME_UTC )) {
26+ fputs ("timespec_get failed!" , stderr );
27+ exit (1 );
28+ }
29+ return (int64_t )tv .tv_nsec / 1000 + (int64_t )tv .tv_sec * 1000000LL ;
30+ #else
1631 struct timeval tv ;
1732 gettimeofday (& tv , NULL );
1833 return (int64_t )tv .tv_usec + (int64_t )tv .tv_sec * 1000000LL ;
34+ #endif
1935}
2036
2137#define FP_EXP (6)
You can’t perform that action at this time.
0 commit comments