#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
void app_main(void)
{
float mesurment;
int first_time;
int second_time;
for (int i = 10; i < 150; i+=10)
{
printf("\n===========\ntime accuracy for %d miliseconds delay\n",i);
first_time=esp_timer_get_time();
vTaskDelay(i/portTICK_RATE_MS);
second_time=esp_timer_get_time();
mesurment=second_time-first_time;
printf("Real mesured time results for %dms delay is: %fms\n===========",i, mesurment/1000);
}
}
Im trying to print the real time delay results of vTaskDelay .... is this code and the results ok?
Re: Im trying to print the real time delay results of vTaskDelay .... is this code and the results ok?
Yes, and probably not.is this code and the results ok?
Assuming you are using default menuconfig values, you probably have freertos scheduler is running with 100Hz.
Try this:
Code: Select all
printf("Real mesured time results for %dms delay is: %fms\n===========",i, mesurment / portTICK_RATE_MS);
Who is online
Users browsing this forum: No registered users and 33 guests