adding freeRtos API from different project
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include "esp_log.h"
|
||||
#include "esp_timer.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "sdkconfig.h"
|
||||
#include <stdio.h>
|
||||
constexpr int StackSize = 1024;
|
||||
|
||||
#include <unity.h>
|
||||
|
||||
class TimeTest {
|
||||
private:
|
||||
bool running{};
|
||||
TickType_t _begin;
|
||||
|
||||
public:
|
||||
TimeTest() {
|
||||
start();
|
||||
}
|
||||
|
||||
void start() {
|
||||
_begin = xTaskGetTickCount();
|
||||
running = true;
|
||||
}
|
||||
|
||||
|
||||
TickType_t getRunTime() {
|
||||
return xTaskGetTickCount() - _begin;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user