@@ -39,6 +39,10 @@ their life cycle:
3939* ` COROUTINE_AWAIT(condition) ` : yield until ` condition ` becomes ` true `
4040* ` COROUTINE_DELAY(millis) ` : yields back execution for ` millis ` . The ` millis `
4141 parameter is defined as a ` uint16_t ` .
42+ * ` COROUTINE_DELAY_MICROS(micros) ` : yields back execution for ` micros ` . The
43+ ` micros ` parameter is defined as a ` uint16_t ` .
44+ * ` COROUTINE_DELAY_SECONDS(seconds) ` : yields back execution for
45+ ` seconds ` . The ` seconds ` parameter is defined as a ` uint16_t ` .
4246* ` COROUTINE_LOOP() ` : convenience macro that loops forever
4347* ` COROUTINE_CHANNEL_WRITE(channel, value) ` : writes a value to a ` Channel `
4448* ` COROUTINE_CHANNEL_READ(channel, value) ` : reads a value from a ` Channel `
@@ -64,16 +68,16 @@ others (in my opinion of course):
6468 * ~ 1.2 microseconds on a 16 MHz ATmega328P
6569 * ~ 0.4 microseconds on a 48 MHz SAMD21
6670 * ~ 0.3 microseconds on a 72 MHz STM32
67- * ~ 0.4 microseconds on a 80 MHz ESP8266
68- * ~ 0.03 microseconds on a 240 MHz ESP32
71+ * ~ 0.3 microseconds on a 80 MHz ESP8266
72+ * ~ 0.1 microseconds on a 240 MHz ESP32
6973 * ~ 0.17 microseconds on 96 MHz Teensy 3.2 (depending on compiler
7074 settings)
7175 * Coroutine Scheduling (use ` CoroutineScheduler::loop() ` ):
72- * ~ 5.2 microseconds on a 16 MHz ATmega328P
73- * ~ 1.9 microseconds on a 48 MHz SAMD21
74- * ~ 1.4 microseconds on a 72 MHz STM32
75- * ~ 1.1 microseconds on a 80 MHz ESP8266
76- * ~ 0.3 microseconds on a 240 MHz ESP32
76+ * ~ 5.5 microseconds on a 16 MHz ATmega328P
77+ * ~ 1.3 microseconds on a 48 MHz SAMD21
78+ * ~ 0.9 microseconds on a 72 MHz STM32
79+ * ~ 0.6 microseconds on a 80 MHz ESP8266
80+ * ~ 0.2 microseconds on a 240 MHz ESP32
7781 * ~ 0.5 microseconds on 96 MHz Teensy 3.2 (depending on compiler
7882 settings)
7983* uses the [ computed goto] ( https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html )
@@ -106,7 +110,7 @@ AceRoutine is a self-contained library that works on any platform supporting the
106110Arduino API (AVR, Teensy, ESP8266, ESP32, etc), and it provides a handful of
107111additional macros that can reduce boilerplate code.
108112
109- ** Version** : 1.3 (2021-06-02)
113+ ** Version** : 1.3.1 (2021-06-02)
110114
111115** Changelog** : [ CHANGELOG.md] ( CHANGELOG.md )
112116
@@ -501,45 +505,69 @@ etc) for a handful of AceRoutine features. Here are some highlights:
501505**Arduino Nano (8-bits)**
502506
503507```
504- +--------------------------------------------------------------+
505- | functionality | flash/ ram | delta |
506- | ---------------------------------+--------------+-------------|
507- | Baseline | 606/ 11 | 0/ 0 |
508- | ---------------------------------+--------------+-------------|
509- | One Delay Function | 654/ 13 | 48/ 2 |
510- | Two Delay Functions | 714/ 15 | 108/ 4 |
511- | ---------------------------------+--------------+-------------|
512- | One Coroutine | 840/ 30 | 234/ 19 |
513- | Two Coroutines | 1010/ 47 | 404/ 36 |
514- | ---------------------------------+--------------+-------------|
515- | Scheduler, One Coroutine | 946/ 32 | 340/ 21 |
516- | Scheduler, Two Coroutines | 1058/ 43 | 452/ 32 |
517- | ---------------------------------+--------------+-------------|
518- | Blink Function | 938/ 14 | 332/ 3 |
519- | Blink Coroutine | 1154/ 30 | 548/ 19 |
520- +--------------------------------------------------------------+
508+ +------------------------------------------------------------------+
509+ | functionality | flash/ ram | delta |
510+ | -------------------------------------+--------------+-------------|
511+ | Baseline | 400/ 11 | 0/ 0 |
512+ | -------------------------------------+--------------+-------------|
513+ | One Delay Function | 450/ 13 | 50/ 2 |
514+ | Two Delay Functions | 508/ 15 | 108/ 4 |
515+ | -------------------------------------+--------------+-------------|
516+ | One Coroutine | 628/ 30 | 228/ 19 |
517+ | Two Coroutines | 796/ 47 | 396/ 36 |
518+ | -------------------------------------+--------------+-------------|
519+ | One Coroutine (micros) | 596/ 30 | 196/ 19 |
520+ | Two Coroutines (micros) | 732/ 47 | 332/ 36 |
521+ | -------------------------------------+--------------+-------------|
522+ | One Coroutine (seconds) | 724/ 30 | 324/ 19 |
523+ | Two Coroutines (seconds) | 920/ 47 | 520/ 36 |
524+ | -------------------------------------+--------------+-------------|
525+ | Scheduler, One Coroutine | 742/ 32 | 342/ 21 |
526+ | Scheduler, Two Coroutines | 904/ 49 | 504/ 38 |
527+ | -------------------------------------+--------------+-------------|
528+ | Scheduler, One Coroutine (micros) | 710/ 32 | 310/ 21 |
529+ | Scheduler, Two Coroutines (micros) | 840/ 49 | 440/ 38 |
530+ | -------------------------------------+--------------+-------------|
531+ | Scheduler, One Coroutine (seconds) | 838/ 32 | 438/ 21 |
532+ | Scheduler, Two Coroutines (seconds) | 1028/ 49 | 628/ 38 |
533+ | -------------------------------------+--------------+-------------|
534+ | Blink Function | 546/ 14 | 146/ 3 |
535+ | Blink Coroutine | 752/ 30 | 352/ 19 |
536+ +------------------------------------------------------------------+
521537```
522538
523539**ESP8266 (32-bits)**
524540
525541```
526- +--------------------------------------------------------------+
527- | functionality | flash/ ram | delta |
528- | ---------------------------------+--------------+-------------|
529- | Baseline | 256924/26800 | 0/ 0 |
530- | ---------------------------------+--------------+-------------|
531- | One Delay Function | 256988/26808 | 64/ 8 |
532- | Two Delay Functions | 257052/26808 | 128/ 8 |
533- | ---------------------------------+--------------+-------------|
534- | One Coroutine | 257104/26820 | 180/ 20 |
535- | Two Coroutines | 257264/26844 | 340/ 44 |
536- | ---------------------------------+--------------+-------------|
537- | Scheduler, One Coroutine | 257152/26828 | 228/ 28 |
538- | Scheduler, Two Coroutines | 257232/26844 | 308/ 44 |
539- | ---------------------------------+--------------+-------------|
540- | Blink Function | 257424/26816 | 500/ 16 |
541- | Blink Coroutine | 257556/26836 | 632/ 36 |
542- +--------------------------------------------------------------+
542+ +------------------------------------------------------------------+
543+ | functionality | flash/ ram | delta |
544+ | -------------------------------------+--------------+-------------|
545+ | Baseline | 256924/26800 | 0/ 0 |
546+ | -------------------------------------+--------------+-------------|
547+ | One Delay Function | 256988/26808 | 64/ 8 |
548+ | Two Delay Functions | 257052/26808 | 128/ 8 |
549+ | -------------------------------------+--------------+-------------|
550+ | One Coroutine | 257104/26820 | 180/ 20 |
551+ | Two Coroutines | 257264/26844 | 340/ 44 |
552+ | -------------------------------------+--------------+-------------|
553+ | One Coroutine (micros) | 257136/26820 | 212/ 20 |
554+ | Two Coroutines (micros) | 257296/26844 | 372/ 44 |
555+ | -------------------------------------+--------------+-------------|
556+ | One Coroutine (seconds) | 257136/26820 | 212/ 20 |
557+ | Two Coroutines (seconds) | 257312/26844 | 388/ 44 |
558+ | -------------------------------------+--------------+-------------|
559+ | Scheduler, One Coroutine | 257152/26828 | 228/ 28 |
560+ | Scheduler, Two Coroutines | 257280/26844 | 356/ 44 |
561+ | -------------------------------------+--------------+-------------|
562+ | Scheduler, One Coroutine (micros) | 257168/26828 | 244/ 28 |
563+ | Scheduler, Two Coroutines (micros) | 257312/26844 | 388/ 44 |
564+ | -------------------------------------+--------------+-------------|
565+ | Scheduler, One Coroutine (seconds) | 257168/26828 | 244/ 28 |
566+ | Scheduler, Two Coroutines (seconds) | 257328/26844 | 404/ 44 |
567+ | -------------------------------------+--------------+-------------|
568+ | Blink Function | 257424/26816 | 500/ 16 |
569+ | Blink Coroutine | 257556/26836 | 632/ 36 |
570+ +------------------------------------------------------------------+
543571```
544572
545573Comparing `Blink Function` and `Blink Coroutine` is probably the most
@@ -567,7 +595,7 @@ Arduino Nano:
567595| ---------------------+--------+-------------+--------|
568596| EmptyLoop | 10000 | 1.700 | 0.000 |
569597| DirectScheduling | 10000 | 2.900 | 1.200 |
570- | CoroutineScheduling | 10000 | 6.900 | 5.200 |
598+ | CoroutineScheduling | 10000 | 7.200 | 5.500 |
571599+---------------------+--------+-------------+--------+
572600```
573601
@@ -577,9 +605,9 @@ ESP8266:
577605+---------------------+--------+-------------+--------+
578606| Functionality | iters | micros/iter | diff |
579607| ---------------------+--------+-------------+--------|
580- | EmptyLoop | 10000 | 0.100 | 0.000 |
581- | DirectScheduling | 10000 | 0.500 | 0.400 |
582- | CoroutineScheduling | 10000 | 1.200 | 1.100 |
608+ | EmptyLoop | 10000 | 0.200 | 0.000 |
609+ | DirectScheduling | 10000 | 0.500 | 0.300 |
610+ | CoroutineScheduling | 10000 | 0.800 | 0.600 |
583611+---------------------+--------+-------------+--------+
584612```
585613
0 commit comments