69 #if defined(ARDUINO_ARCH_SAMD) && (USB_PID == 0x8D21) 70 #define Serial SerialUSB 77 unsigned long start, stop, us;
82 Serial.println(F(
"SchedulerBenchmark: started"));
90 Serial.print(F(
"1. Initiate scheduler and main task: "));
92 Serial.println(F(
" us"));
97 for (
int i = 0; i < 10000; i++)
101 Serial.print(F(
"2. Yield main task: "));
102 Serial.print(us / 10000.0);
103 Serial.println(F(
" us"));
111 Serial.print(F(
"3. Start a task: "));
113 Serial.println(F(
" us"));
118 for (
int i = 0; i < 10000; i++)
122 if (
counter != 10000) Serial.println(F(
"Error: counter"));
123 Serial.print(F(
"4. Yield between two tasks: "));
124 Serial.print(us / 10000.0);
125 Serial.println(F(
" us"));
134 Serial.print(F(
"5. Delay 10 ms and check increments: "));
136 Serial.print(F(
":"));
138 Serial.print(F(
", "));
139 Serial.print(us / (
float)
counter);
140 Serial.println(F(
" us"));
149 Serial.print(F(
"6. Start "));
151 Serial.print(F(
" tasks: "));
153 Serial.print(F(
":"));
155 Serial.print(F(
", "));
156 Serial.print(us / (
float) nr);
157 Serial.println(F(
" us"));
166 Serial.print(F(
"7. Yield and check increments: "));
168 Serial.print(F(
":"));
169 Serial.print(counter);
170 Serial.print(F(
", "));
171 Serial.print(us / (
float) counter);
172 Serial.println(F(
" us"));
181 Serial.print(F(
"8. Delay 10 ms and check increments: "));
183 Serial.print(F(
":"));
184 Serial.print(counter);
185 Serial.print(F(
", "));
186 Serial.print(us / (
float) counter);
187 Serial.println(F(
" us"));
static bool startLoop(func_t taskLoop, size_t stackSize=DEFAULT_STACK_SIZE)
static bool begin(size_t stackSize)