This commit is contained in:
2024-09-09 08:40:12 +08:00
parent 6c0d5642ba
commit eca3fb03f2

7
main.c
View File

@@ -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()