File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 7
7
#ifndef SECP256K1_BENCH_H
8
8
#define SECP256K1_BENCH_H
9
9
10
+ #include <stdlib.h>
10
11
#include <stdint.h>
11
12
#include <stdio.h>
12
13
#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
14
20
15
21
static 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
16
31
struct timeval tv ;
17
32
gettimeofday (& tv , NULL );
18
33
return (int64_t )tv .tv_usec + (int64_t )tv .tv_sec * 1000000LL ;
34
+ #endif
19
35
}
20
36
21
37
#define FP_EXP (6)
You can’t perform that action at this time.
0 commit comments