I'm starting to use queuing functions, so one of the things I wanted to check was whether it is any slower to use the queues compared to some other ways of data exchange between two tasks.
I created two tasks - Task A queues up a structure into the queue and Task B reads is. To test how fast this happens, I added a member to a structure where I put a "system time" - (xTaskGetTickCount() * portTICK_PERIOD_MS) right before Task A writes the structure into the queue. After receiving the queued structure, Task B gets current "system time" and compares it with the one received from Task A.
Task B is always ready to read from the queue - that's all it does. The difference between these two times is usually 0, but sometimes it is 10 mSec. Since my configTICK_RATE_HZ is 100 and portTICK_PERIOD_MS = 1000/100 = 10, the difference is always a multiple of 10. So - everything is clear, no problems here.
What I don't understand is my log where I see all these results. I'm using ESP_LOGI() function to make log entries. Every entry starts with a number that looks like what I earlier called a "system time" - number of ticks from the start of the scheduler. It would make sense that this number is close to the time that Task B got from the system. However, every time there is about 700 (most likely mSec) difference between these two numbers. I understand that it takes some time to create a log entry, but it most certainly doesn't take 700 mSec fo do that.
My question is - do you know what is this number provided by the log functions and why is it different from the one supplied by xTaskGetTickCount().
Thanks a lot.
Examples of log entries from Task B:
I (17542) Data In - 16900, Data Out - 16900.
I (17592) Data In - 16950, Data Out - 16950.
I (17632) Data In - 16990, Data Out - 16990.
System time in logging functions?
Return to “General Discussion”
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 87 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.