-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMemoryBenchmark.ino
463 lines (443 loc) · 18.8 KB
/
MemoryBenchmark.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
/*
* Determine the size of various components of the AceTime library.
*/
#include <stdint.h> // uint8_t
#include <Arduino.h>
// List of features of the AceTime library that we want to examine.
#define FEATURE_BASELINE 0
#define FEATURE_LOCAL_DATE_TIME 1
#define FEATURE_ZONED_DATE_TIME 2
#define FEATURE_MANUAL_ZONE_MANAGER 3
#define FEATURE_BASIC_TIME_ZONE 4
#define FEATURE_BASIC_TIME_ZONE2 5
#define FEATURE_BASIC_ZONE_MANAGER_ONE 6
#define FEATURE_BASIC_ZONE_MANAGER_ZONES 7
#define FEATURE_BASIC_ZONE_MANAGER_ZONES_AND_LINKS 8
#define FEATURE_BASIC_ZONE_SORTER_BY_NAME 9
#define FEATURE_BASIC_ZONE_SORTER_BY_OFFSET_AND_NAME 10
#define FEATURE_EXTENDED_TIME_ZONE 11
#define FEATURE_EXTENDED_TIME_ZONE2 12
#define FEATURE_EXTENDED_ZONE_MANAGER_ONE 13
#define FEATURE_EXTENDED_ZONE_MANAGER_ZONES 14
#define FEATURE_EXTENDED_ZONE_MANAGER_ZONES_AND_LINKS 15
#define FEATURE_EXTENDED_ZONE_SORTER_BY_NAME 16
#define FEATURE_EXTENDED_ZONE_SORTER_BY_OFFSET_AND_NAME 17
#define FEATURE_COMPLETE_TIME_ZONE 18
#define FEATURE_COMPLETE_TIME_ZONE2 19
#define FEATURE_COMPLETE_ZONE_MANAGER_ONE 20
#define FEATURE_COMPLETE_ZONE_MANAGER_ZONES 21
#define FEATURE_COMPLETE_ZONE_MANAGER_ZONES_AND_LINKS 22
#define FEATURE_COMPLETE_ZONE_SORTER_BY_NAME 23
#define FEATURE_COMPLETE_ZONE_SORTER_BY_OFFSET_AND_NAME 24
// Select one of the FEATURE_* parameter and compile. Then look at the flash
// and RAM usage, compared to FEATURE_BASELINE usage to determine how much
// flash and RAM is consumed by the selected feature.
// NOTE: This line is modified by a 'sed' script in collect.sh. Be careful
// when modifying its format.
#define FEATURE 0
#if FEATURE != FEATURE_BASELINE
#include <AceTime.h>
using namespace ace_time;
#endif
// Set this variable to prevent the compiler optimizer from removing the code
// being tested when it determines that it does nothing.
volatile int guard;
// Use this instead of a constant to prevent the compiler from calculating
// certain values (e.g. toEpochSeconds()) at compile-time.
volatile int16_t year = 2019;
// Create the various objects that we want to measure as global variables so
// that their static memory consumption is detected. The previous version placed
// all these inside the setup() method, which creates the objects on the stack,
// which do not get detected as memory consumption, so don't show up in the
// *.txt files.
#if FEATURE == FEATURE_LOCAL_DATE_TIME
auto dt = LocalDateTime::forComponents(year, 6, 17, 9, 18, 0);
#elif FEATURE == FEATURE_ZONED_DATE_TIME
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, TimeZone());
#elif FEATURE == FEATURE_MANUAL_ZONE_MANAGER
ManualZoneManager manager;
#elif FEATURE == FEATURE_BASIC_TIME_ZONE
BasicZoneProcessor processor;
#elif FEATURE == FEATURE_BASIC_TIME_ZONE2
// Same as FEATURE_BASIC_TIME_ZONE but with 2 zones
BasicZoneProcessor processor1;
BasicZoneProcessor processor2;
#elif FEATURE == FEATURE_BASIC_ZONE_MANAGER_ONE
static const basic::ZoneInfo* const kBasicZoneRegistry[] ACE_TIME_PROGMEM = {
&zonedb::kZoneAmerica_Los_Angeles,
};
static const uint16_t kBasicZoneRegistrySize =
sizeof(kBasicZoneRegistry) / sizeof(basic::ZoneInfo*);
BasicZoneProcessorCache<1> zoneProcessorCache;
BasicZoneManager manager(
kBasicZoneRegistrySize,
kBasicZoneRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_BASIC_ZONE_MANAGER_ZONES
BasicZoneProcessorCache<1> zoneProcessorCache;
BasicZoneManager manager(
zonedb::kZoneRegistrySize,
zonedb::kZoneRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_BASIC_ZONE_MANAGER_ZONES_AND_LINKS
BasicZoneProcessorCache<1> zoneProcessorCache;
BasicZoneManager manager(
zonedb::kZoneAndLinkRegistrySize,
zonedb::kZoneAndLinkRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_BASIC_ZONE_SORTER_BY_NAME
// Construct the same BasicZoneManager as FEATURE_BASIC_TIME_ZONE, then
// subtract its memory consumption numbers to isolate just the
// ZoneSorterByName.
static const basic::ZoneInfo* const kBasicZoneRegistry[] ACE_TIME_PROGMEM = {
&zonedb::kZoneAmerica_Los_Angeles,
};
static const uint16_t kBasicZoneRegistrySize =
sizeof(kBasicZoneRegistry) / sizeof(basic::ZoneInfo*);
BasicZoneProcessorCache<1> zoneProcessorCache;
BasicZoneManager manager(
kBasicZoneRegistrySize,
kBasicZoneRegistry,
zoneProcessorCache);
ZoneSorterByName<BasicZoneManager> zoneSorter(manager);
#elif FEATURE == FEATURE_BASIC_ZONE_SORTER_BY_OFFSET_AND_NAME
// Construct the same BasicZoneManager as FEATURE_BASIC_TIME_ZONE, then
// subtract its memory consumption numbers to isolate just the
// ZoneSorterByOffsetAndName.
static const basic::ZoneInfo* const kBasicZoneRegistry[] ACE_TIME_PROGMEM = {
&zonedb::kZoneAmerica_Los_Angeles,
};
static const uint16_t kBasicZoneRegistrySize =
sizeof(kBasicZoneRegistry) / sizeof(basic::ZoneInfo*);
BasicZoneProcessorCache<1> zoneProcessorCache;
BasicZoneManager manager(
kBasicZoneRegistrySize,
kBasicZoneRegistry,
zoneProcessorCache);
ZoneSorterByOffsetAndName<BasicZoneManager> zoneSorter(manager);
#elif FEATURE == FEATURE_EXTENDED_TIME_ZONE
ExtendedZoneProcessor processor;
auto tz = TimeZone::forZoneInfo(&zonedbx::kZoneAmerica_Los_Angeles,
&processor);
#elif FEATURE == FEATURE_EXTENDED_TIME_ZONE2
// Same as FEATURE_EXTENDED_TIME_ZONE but with 2 zones
ExtendedZoneProcessor processor1;
ExtendedZoneProcessor processor2;
auto tz1 = TimeZone::forZoneInfo(&zonedbx::kZoneAmerica_Los_Angeles,
&processor1);
auto tz2 = TimeZone::forZoneInfo(&zonedbx::kZoneEurope_Amsterdam,
&processor2);
#elif FEATURE == FEATURE_EXTENDED_ZONE_MANAGER_ONE
static const extended::ZoneInfo* const kExtendedZoneRegistry[]
ACE_TIME_PROGMEM = {
&zonedbx::kZoneAmerica_Los_Angeles,
};
static const uint16_t kExtendedZoneRegistrySize =
sizeof(kExtendedZoneRegistry) / sizeof(extended::ZoneInfo*);
ExtendedZoneProcessorCache<1> zoneProcessorCache;
ExtendedZoneManager manager(
kExtendedZoneRegistrySize,
kExtendedZoneRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_EXTENDED_ZONE_MANAGER_ZONES
ExtendedZoneProcessorCache<1> zoneProcessorCache;
ExtendedZoneManager manager(
zonedbx::kZoneRegistrySize,
zonedbx::kZoneRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_EXTENDED_ZONE_MANAGER_ZONES_AND_LINKS
ExtendedZoneProcessorCache<1> zoneProcessorCache;
ExtendedZoneManager manager(
zonedbx::kZoneAndLinkRegistrySize,
zonedbx::kZoneAndLinkRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_EXTENDED_ZONE_SORTER_BY_NAME
// Construct the same ExtendedZoneManager as FEATURE_EXTENDED_TIME_ZONE, then
// subtract its memory consumption numbers to isolate just the
// ZoneSorterByName.
static const extended::ZoneInfo* const kExtendedZoneRegistry[]
ACE_TIME_PROGMEM = {
&zonedbx::kZoneAmerica_Los_Angeles,
};
static const uint16_t kExtendedZoneRegistrySize =
sizeof(kExtendedZoneRegistry) / sizeof(extended::ZoneInfo*);
ExtendedZoneProcessorCache<1> zoneProcessorCache;
ExtendedZoneManager manager(
kExtendedZoneRegistrySize,
kExtendedZoneRegistry,
zoneProcessorCache);
ZoneSorterByName<ExtendedZoneManager> zoneSorter(manager);
#elif FEATURE == FEATURE_EXTENDED_ZONE_SORTER_BY_OFFSET_AND_NAME
// Construct the same ExtendedZoneManager as FEATURE_EXTENDED_TIME_ZONE, then
// subtract its memory consumption numbers to isolate just the
// ZoneSorterByOffsetAndName.
static const extended::ZoneInfo* const kExtendedZoneRegistry[]
ACE_TIME_PROGMEM = {
&zonedbx::kZoneAmerica_Los_Angeles,
};
static const uint16_t kExtendedZoneRegistrySize =
sizeof(kExtendedZoneRegistry) / sizeof(extended::ZoneInfo*);
ExtendedZoneProcessorCache<1> zoneProcessorCache;
ExtendedZoneManager manager(
kExtendedZoneRegistrySize,
kExtendedZoneRegistry,
zoneProcessorCache);
ZoneSorterByOffsetAndName<ExtendedZoneManager> zoneSorter(manager);
#elif FEATURE == FEATURE_COMPLETE_TIME_ZONE
#if defined(ARDUINO_ARCH_AVR)
#error Unsupported FEATURE on this platform
#endif
CompleteZoneProcessor processor;
auto tz = TimeZone::forZoneInfo(&zonedbc::kZoneAmerica_Los_Angeles,
&processor);
#elif FEATURE == FEATURE_COMPLETE_TIME_ZONE2
#if defined(ARDUINO_ARCH_AVR)
#error Unsupported FEATURE on this platform
#endif
// Same as FEATURE_COMPLETE_TIME_ZONE but with 2 zones
CompleteZoneProcessor processor1;
CompleteZoneProcessor processor2;
auto tz1 = TimeZone::forZoneInfo(&zonedbc::kZoneAmerica_Los_Angeles,
&processor1);
auto tz2 = TimeZone::forZoneInfo(&zonedbc::kZoneEurope_Amsterdam,
&processor2);
#elif FEATURE == FEATURE_COMPLETE_ZONE_MANAGER_ONE
#if defined(ARDUINO_ARCH_AVR)
#error Unsupported FEATURE on this platform
#endif
static const complete::ZoneInfo* const kCompleteZoneRegistry[]
ACE_TIME_PROGMEM = {
&zonedbc::kZoneAmerica_Los_Angeles,
};
static const uint16_t kCompleteZoneRegistrySize =
sizeof(kCompleteZoneRegistry) / sizeof(complete::ZoneInfo*);
CompleteZoneProcessorCache<1> zoneProcessorCache;
CompleteZoneManager manager(
kCompleteZoneRegistrySize,
kCompleteZoneRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_COMPLETE_ZONE_MANAGER_ZONES
#if defined(ARDUINO_ARCH_AVR)
#error Unsupported FEATURE on this platform
#endif
CompleteZoneProcessorCache<1> zoneProcessorCache;
CompleteZoneManager manager(
zonedbc::kZoneRegistrySize,
zonedbc::kZoneRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_COMPLETE_ZONE_MANAGER_ZONES_AND_LINKS
#if defined(ARDUINO_ARCH_AVR)
#error Unsupported FEATURE on this platform
#endif
CompleteZoneProcessorCache<1> zoneProcessorCache;
CompleteZoneManager manager(
zonedbc::kZoneAndLinkRegistrySize,
zonedbc::kZoneAndLinkRegistry,
zoneProcessorCache);
#elif FEATURE == FEATURE_COMPLETE_ZONE_SORTER_BY_NAME
#if defined(ARDUINO_ARCH_AVR)
#error Unsupported FEATURE on this platform
#endif
// Construct the same CompleteZoneManager as FEATURE_COMPLETE_TIME_ZONE, then
// subtract its memory consumption numbers to isolate just the
// ZoneSorterByName.
static const complete::ZoneInfo* const kCompleteZoneRegistry[]
ACE_TIME_PROGMEM = {
&zonedbc::kZoneAmerica_Los_Angeles,
};
static const uint16_t kCompleteZoneRegistrySize =
sizeof(kCompleteZoneRegistry) / sizeof(complete::ZoneInfo*);
CompleteZoneProcessorCache<1> zoneProcessorCache;
CompleteZoneManager manager(
kCompleteZoneRegistrySize,
kCompleteZoneRegistry,
zoneProcessorCache);
ZoneSorterByName<CompleteZoneManager> zoneSorter(manager);
#elif FEATURE == FEATURE_COMPLETE_ZONE_SORTER_BY_OFFSET_AND_NAME
#if defined(ARDUINO_ARCH_AVR)
#error Unsupported FEATURE on this platform
#endif
// Construct the same CompleteZoneManager as FEATURE_COMPLETE_TIME_ZONE, then
// subtract its memory consumption numbers to isolate just the
// ZoneSorterByOffsetAndName.
static const complete::ZoneInfo* const kCompleteZoneRegistry[]
ACE_TIME_PROGMEM = {
&zonedbc::kZoneAmerica_Los_Angeles,
};
static const uint16_t kCompleteZoneRegistrySize =
sizeof(kCompleteZoneRegistry) / sizeof(complete::ZoneInfo*);
CompleteZoneProcessorCache<1> zoneProcessorCache;
CompleteZoneManager manager(
kCompleteZoneRegistrySize,
kCompleteZoneRegistry,
zoneProcessorCache);
ZoneSorterByOffsetAndName<CompleteZoneManager> zoneSorter(manager);
#endif
// TeensyDuino seems to pull in malloc() and free() when a class with virtual
// functions is used polymorphically. This causes the memory consumption of
// FEATURE_BASELINE (which normally has no classes defined, so does not include
// malloc() and free()) to be artificially small which throws off the memory
// consumption calculations for all subsequent features. Let's define a
// throw-away class and call its method for all FEATURES, including BASELINE.
#if defined(TEENSYDUINO)
class FooClass {
public:
virtual void doit() {
guard = 0;
}
};
FooClass* foo;
#endif
void setup() {
#if defined(TEENSYDUINO)
// Force Teensy to bring in malloc(), free() and other things for virtual
// dispatch.
foo = new FooClass();
#endif
#if FEATURE == FEATURE_BASELINE
guard = 0;
#elif FEATURE == FEATURE_LOCAL_DATE_TIME
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_ZONED_DATE_TIME
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_MANUAL_ZONE_MANAGER
TimeZoneData tzd = { -8*60 /*stdMinutes*/, 60 /*dstMinutes*/ };
auto tz = manager.createForTimeZoneData(tzd);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_BASIC_TIME_ZONE
auto tz = TimeZone::forZoneInfo(&zonedb::kZoneAmerica_Los_Angeles,
&processor);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_BASIC_TIME_ZONE2
// Same as FEATURE_BASIC_TIME_ZONE but with 2 zones
auto tz1 = TimeZone::forZoneInfo(&zonedb::kZoneAmerica_Los_Angeles,
&processor1);
auto tz2 = TimeZone::forZoneInfo(&zonedb::kZoneEurope_Amsterdam,
&processor2);
auto dt1 = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz1);
auto dt2 = dt1.convertToTimeZone(tz2);
acetime_t epochSeconds = dt2.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_BASIC_ZONE_MANAGER_ONE
auto tz = manager.createForZoneInfo(&zonedb::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_BASIC_ZONE_MANAGER_ZONES
auto tz = manager.createForZoneInfo(&zonedb::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_BASIC_ZONE_MANAGER_ZONES_AND_LINKS
auto tz = manager.createForZoneInfo(&zonedb::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_BASIC_ZONE_SORTER_BY_NAME
auto tz = manager.createForZoneInfo(&zonedb::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
uint16_t indexes[2] = {0, 1};
zoneSorter.sortIndexes(indexes, 2);
guard ^= indexes[0];
#elif FEATURE == FEATURE_BASIC_ZONE_SORTER_BY_OFFSET_AND_NAME
auto tz = manager.createForZoneInfo(&zonedb::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
uint16_t indexes[2] = {0, 1};
zoneSorter.sortIndexes(indexes, 2);
guard ^= indexes[0];
#elif FEATURE == FEATURE_EXTENDED_TIME_ZONE
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_EXTENDED_TIME_ZONE2
auto dt1 = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz1);
auto dt2 = dt1.convertToTimeZone(tz2);
acetime_t epochSeconds = dt2.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_EXTENDED_ZONE_MANAGER_ONE
auto tz = manager.createForZoneInfo(&zonedbx::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_EXTENDED_ZONE_MANAGER_ZONES
auto tz = manager.createForZoneInfo(&zonedbx::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_EXTENDED_ZONE_MANAGER_ZONES_AND_LINKS
auto tz = manager.createForZoneInfo(&zonedbx::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_EXTENDED_ZONE_SORTER_BY_NAME
auto tz = manager.createForZoneInfo(&zonedbx::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
uint16_t indexes[2] = {0, 1};
zoneSorter.sortIndexes(indexes, 2);
guard ^= indexes[0];
#elif FEATURE == FEATURE_EXTENDED_ZONE_SORTER_BY_OFFSET_AND_NAME
auto tz = manager.createForZoneInfo(&zonedbx::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
uint16_t indexes[2] = {0, 1};
zoneSorter.sortIndexes(indexes, 2);
guard ^= indexes[0];
#elif FEATURE == FEATURE_COMPLETE_TIME_ZONE
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_COMPLETE_TIME_ZONE2
auto dt1 = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz1);
auto dt2 = dt1.convertToTimeZone(tz2);
acetime_t epochSeconds = dt2.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_COMPLETE_ZONE_MANAGER_ONE
auto tz = manager.createForZoneInfo(&zonedbc::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_COMPLETE_ZONE_MANAGER_ZONES
auto tz = manager.createForZoneInfo(&zonedbc::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_COMPLETE_ZONE_MANAGER_ZONES_AND_LINKS
auto tz = manager.createForZoneInfo(&zonedbc::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
#elif FEATURE == FEATURE_COMPLETE_ZONE_SORTER_BY_NAME
auto tz = manager.createForZoneInfo(&zonedbc::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
uint16_t indexes[2] = {0, 1};
zoneSorter.sortIndexes(indexes, 2);
guard ^= indexes[0];
#elif FEATURE == FEATURE_COMPLETE_ZONE_SORTER_BY_OFFSET_AND_NAME
auto tz = manager.createForZoneInfo(&zonedbc::kZoneAmerica_Los_Angeles);
auto dt = ZonedDateTime::forComponents(year, 6, 17, 9, 18, 0, tz);
acetime_t epochSeconds = dt.toEpochSeconds();
guard ^= epochSeconds;
uint16_t indexes[2] = {0, 1};
zoneSorter.sortIndexes(indexes, 2);
guard ^= indexes[0];
#else
#error Unknown FEATURE
#endif
}
void loop() {
}