I can't print clock_t as a double or print time elapsed
void app_main()
{
clock_t start, end;
long double cpu_time_used;
start = clock();
ESP_LOGI(TAG, "Elapsed time");
ESP_LOGI(TAG, "Starting time: %Lf", (long double)start);
end = clock();
ESP_LOGI(TAG, "Ending time: %ld", end);
cpu_time_used = (( long double) (end - start)) / CLOCKS_PER_SEC;
ESP_LOGI(TAG, "Elapsed time: %Lf ms", cpu_time_used);
}
and this is my log:
I (241) application using mex: Elapsed time
I (243) application using mex: Starting time:
I (248) application using mex: Ending time: 2
I (255) application using mex: Elapsed time: ms
I (264) application using mex: Elapsed time: s
I really don't understand why