@@ -132,8 +132,6 @@ static void err_msg(const char* s)
132132#else
133133 #include <sys/time.h>
134134
135- double current_time_ms (int );
136-
137135 /* return number of seconds*/
138136 word32 current_time (int reset )
139137 {
@@ -145,6 +143,9 @@ static void err_msg(const char* s)
145143 return (word32 )tv .tv_sec ;
146144 }
147145
146+ #ifdef EXAMPLE_SFTP_BENCHMARK
147+ double current_time_ms (int );
148+
148149 /* return number of micro seconds */
149150 double current_time_ms (int reset )
150151 {
@@ -155,7 +156,7 @@ static void err_msg(const char* s)
155156 gettimeofday (& tv , 0 );
156157 return (word64 )(tv .tv_sec * 1000000 ) + tv .tv_usec ;
157158 }
158-
159+ #endif
159160#endif /* USE_WINDOWS_API */
160161#endif /* !WOLFSSH_NO_TIMESTAMP */
161162
@@ -1107,7 +1108,8 @@ static int doAutopilot(int cmd, char* local, char* remote)
11071108 char fullpath [128 ] = "." ;
11081109 WS_SFTPNAME * name = NULL ;
11091110 byte remoteAbsPath = 0 ;
1110- #if !defined(WOLFSSH_NO_TIMESTAMP ) && !defined(USE_WINDOWS_API )
1111+ #if !defined(WOLFSSH_NO_TIMESTAMP ) && !defined(USE_WINDOWS_API ) && \
1112+ defined(EXAMPLE_SFTP_BENCHMARK )
11111113 double currentTime ;
11121114 double longBytes = 0 ;
11131115 FILE * f ;
@@ -1144,7 +1146,8 @@ static int doAutopilot(int cmd, char* local, char* remote)
11441146 remote );
11451147 }
11461148
1147- #if !defined(WOLFSSH_NO_TIMESTAMP ) && !defined(USE_WINDOWS_API )
1149+ #if !defined(WOLFSSH_NO_TIMESTAMP ) && !defined(USE_WINDOWS_API ) && \
1150+ defined(EXAMPLE_SFTP_BENCHMARK )
11481151 ret = WFOPEN (NULL , & f , fullpath , "rb" );
11491152 if (ret != 0 || f == WBADFILE ) return WS_BAD_FILE_E ;
11501153 if (WFSEEK (NULL , f , 0 , WSEEK_END ) != 0 ) {
@@ -1177,7 +1180,8 @@ static int doAutopilot(int cmd, char* local, char* remote)
11771180 fullpath , local );
11781181 }
11791182 }
1180- #if !defined(WOLFSSH_NO_TIMESTAMP ) && !defined(USE_WINDOWS_API )
1183+ #if !defined(WOLFSSH_NO_TIMESTAMP ) && !defined(USE_WINDOWS_API ) && \
1184+ defined(EXAMPLE_SFTP_BENCHMARK )
11811185 else {
11821186 currentTime = current_time_ms (0 ) - currentTime ;
11831187 double result ;
0 commit comments