43 #define URL_BASE "http://speedtest.your.domain/" 44 #define URL_1M URL_BASE "file_1M.bin" 45 #define URL_2M URL_BASE "file_2M.bin" 46 #define URL_5M URL_BASE "file_5M.bin" 47 #define URL_10M URL_BASE "file_10M.bin" 48 #define URL_20M URL_BASE "file_20M.bin" 49 #define URL_50M URL_BASE "file_50M.bin" 50 #define URL_100M URL_BASE "file_100M.bin" 52 #define CHKSPEED_VERSION "1.0" 60 return (
size_t)(size * nmemb);
63 int main(
int argc,
char *argv[])
67 int prtall = 0, prtsep = 0, prttime = 0;
69 char *appname = argv[0];
73 for(argc--, argv++; *argv; argc--, argv++) {
77 "\rUsage: %s [-m=1|2|5|10|20|50|100] [-t] [-x] [url]\n",
82 fprintf(stderr,
"\r%s %s - %s\n",
96 long m = strtol((*argv) + 3, NULL, 10);
120 fprintf(stderr,
"\r%s: invalid parameter %s\n",
126 fprintf(stderr,
"\r%s: invalid or unknown option %s\n",
139 printf(
"-------------------------------------------------\n");
143 time_t
t = time(NULL);
144 printf(
"Localtime: %s", ctime(&t));
173 printf(
"Data downloaded: %0.0f bytes.\n", val);
178 printf(
"Total download time: %0.3f sec.\n", val);
183 printf(
"Average download speed: %0.3f kbyte/sec.\n", val / 1024);
189 printf(
"Name lookup time: %0.3f sec.\n", val);
194 printf(
"Connect time: %0.3f sec.\n", val);
198 fprintf(stderr,
"Error while fetching '%s' : %s\n",
static size_t WriteCallback(void *ptr, size_t size, size_t nmemb, void *data)
UNITTEST_START char * ptr
geometry_msgs::TransformStamped t
#define curl_easy_setopt(handle, option, value)
int main(int argc, char *argv[])
#define curl_easy_getinfo(handle, info, arg)
CURL_EXTERN CURL * curl_easy_init(void)
CURL_EXTERN void curl_easy_cleanup(CURL *curl)
CURL_EXTERN CURLcode curl_global_init(long flags)
curl_global_init() globally initializes curl given a bitwise set of the different features of what to...
CURL_EXTERN void curl_global_cleanup(void)
curl_global_cleanup() globally cleanups curl, uses the value of "init_flags" to determine what needs ...
CURL_EXTERN const char * curl_easy_strerror(CURLcode)
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl)
CURL_EXTERN char * curl_version(void)