optimize
This commit is contained in:
7
main.c
7
main.c
@@ -116,8 +116,9 @@ CURLcode curl_get(const char *const url, struct memory *chunk)
|
|||||||
|
|
||||||
long long current_timestamp()
|
long long current_timestamp()
|
||||||
{
|
{
|
||||||
time_t timestamp = time(NULL);
|
const time_t timestamp = time(NULL);
|
||||||
return timestamp * 1000;
|
srand(timestamp);
|
||||||
|
return timestamp * 1000 + (rand() % 1999 - 999); // -999 ~ 999
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t cb(char *data, size_t size, size_t nmemb, void *clientp)
|
size_t cb(char *data, size_t size, size_t nmemb, void *clientp)
|
||||||
@@ -197,7 +198,7 @@ void parise(void *arg)
|
|||||||
|
|
||||||
cJSON_Delete(json);
|
cJSON_Delete(json);
|
||||||
}
|
}
|
||||||
printf("Signal: exit, T%d exiting\n", idx);
|
fprintf(stderr, "\rSignal Received: exit. T%d exiting\n", idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void exit_handler()
|
void exit_handler()
|
||||||
|
|||||||
Reference in New Issue
Block a user