-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathAutoBenchmark.ino
189 lines (129 loc) · 6.86 KB
/
AutoBenchmark.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
/*
* A program to determine how long it takes to execute some of the more complex
* features of the AceTime library.
*
* This should compile on all microcontrollers supported by the Arduino IDE.
*/
#include <Arduino.h>
#include <AceTime.h>
#include "Benchmark.h"
using namespace ace_time;
void setup() {
#if ! defined(EPOXY_DUINO)
delay(8000); // STM32, ESP8266, ESP32 now require > 5000ms instead of 1000ms
#endif
SERIAL_PORT_MONITOR.begin(115200);
while (!SERIAL_PORT_MONITOR); // Wait until ready - Leonardo/Micro
#if defined(EPOXY_DUINO)
SERIAL_PORT_MONITOR.setLineModeUnix();
#endif
SERIAL_PORT_MONITOR.println(F("SIZEOF"));
// print sizeof() various ace_time primitives
SERIAL_PORT_MONITOR.print(F("sizeof(LocalDate): "));
SERIAL_PORT_MONITOR.println(sizeof(LocalDate));
SERIAL_PORT_MONITOR.print(F("sizeof(LocalTime): "));
SERIAL_PORT_MONITOR.println(sizeof(LocalTime));
SERIAL_PORT_MONITOR.print(F("sizeof(LocalDateTime): "));
SERIAL_PORT_MONITOR.println(sizeof(LocalDateTime));
SERIAL_PORT_MONITOR.print(F("sizeof(TimeOffset): "));
SERIAL_PORT_MONITOR.println(sizeof(TimeOffset));
SERIAL_PORT_MONITOR.print(F("sizeof(OffsetDateTime): "));
SERIAL_PORT_MONITOR.println(sizeof(OffsetDateTime));
SERIAL_PORT_MONITOR.print(F("sizeof(TimeZone): "));
SERIAL_PORT_MONITOR.println(sizeof(TimeZone));
SERIAL_PORT_MONITOR.print(F("sizeof(TimeZoneData): "));
SERIAL_PORT_MONITOR.println(sizeof(TimeZoneData));
SERIAL_PORT_MONITOR.print(F("sizeof(ZonedDateTime): "));
SERIAL_PORT_MONITOR.println(sizeof(ZonedDateTime));
SERIAL_PORT_MONITOR.print(F("sizeof(ZonedExtra): "));
SERIAL_PORT_MONITOR.println(sizeof(ZonedExtra));
SERIAL_PORT_MONITOR.print(F("sizeof(TimePeriod): "));
SERIAL_PORT_MONITOR.println(sizeof(TimePeriod));
// Basic
SERIAL_PORT_MONITOR.println(F("Basic:"));
SERIAL_PORT_MONITOR.print(F(" sizeof(basic::Info::ZoneContext): "));
SERIAL_PORT_MONITOR.println(sizeof(basic::Info::ZoneContext));
SERIAL_PORT_MONITOR.print(F(" sizeof(basic::Info::ZoneEra): "));
SERIAL_PORT_MONITOR.println(sizeof(basic::Info::ZoneEra));
SERIAL_PORT_MONITOR.print(F(" sizeof(basic::Info::ZoneInfo): "));
SERIAL_PORT_MONITOR.println(sizeof(basic::Info::ZoneInfo));
SERIAL_PORT_MONITOR.print(F(" sizeof(basic::Info::ZoneRule): "));
SERIAL_PORT_MONITOR.println(sizeof(basic::Info::ZoneRule));
SERIAL_PORT_MONITOR.print(F(" sizeof(basic::Info::ZonePolicy): "));
SERIAL_PORT_MONITOR.println(sizeof(basic::Info::ZonePolicy));
SERIAL_PORT_MONITOR.print(F(" sizeof(basic::ZoneRegistrar): "));
SERIAL_PORT_MONITOR.println(sizeof(basic::ZoneRegistrar));
SERIAL_PORT_MONITOR.print(F(" sizeof(BasicZoneProcessor): "));
SERIAL_PORT_MONITOR.println(sizeof(BasicZoneProcessor));
SERIAL_PORT_MONITOR.print(F(" sizeof(BasicZoneProcessorCache<1>): "));
SERIAL_PORT_MONITOR.println(sizeof(BasicZoneProcessorCache<1>));
SERIAL_PORT_MONITOR.print(F(" sizeof(BasicZoneManager): "));
SERIAL_PORT_MONITOR.println(sizeof(BasicZoneManager));
SERIAL_PORT_MONITOR.print(F(" sizeof(BasicZoneProcessor::Transition): "));
SERIAL_PORT_MONITOR.println(sizeof(BasicZoneProcessor::Transition));
// Extended
SERIAL_PORT_MONITOR.println(F("Extended:"));
SERIAL_PORT_MONITOR.print(F(" sizeof(extended::Info::ZoneContext): "));
SERIAL_PORT_MONITOR.println(sizeof(extended::Info::ZoneContext));
SERIAL_PORT_MONITOR.print(F(" sizeof(extended::Info::ZoneEra): "));
SERIAL_PORT_MONITOR.println(sizeof(extended::Info::ZoneEra));
SERIAL_PORT_MONITOR.print(F(" sizeof(extended::Info::ZoneInfo): "));
SERIAL_PORT_MONITOR.println(sizeof(extended::Info::ZoneInfo));
SERIAL_PORT_MONITOR.print(F(" sizeof(extended::Info::ZoneRule): "));
SERIAL_PORT_MONITOR.println(sizeof(extended::Info::ZoneRule));
SERIAL_PORT_MONITOR.print(F(" sizeof(extended::Info::ZonePolicy): "));
SERIAL_PORT_MONITOR.println(sizeof(extended::Info::ZonePolicy));
SERIAL_PORT_MONITOR.print(F(" sizeof(extended::ZoneRegistrar): "));
SERIAL_PORT_MONITOR.println(sizeof(extended::ZoneRegistrar));
SERIAL_PORT_MONITOR.print(F(" sizeof(ExtendedZoneProcessor): "));
SERIAL_PORT_MONITOR.println(sizeof(ExtendedZoneProcessor));
SERIAL_PORT_MONITOR.print(F(" sizeof(ExtendedZoneProcessorCache<1>): "));
SERIAL_PORT_MONITOR.println(sizeof(ExtendedZoneProcessorCache<1>));
SERIAL_PORT_MONITOR.print(F(" sizeof(ExtendedZoneManager): "));
SERIAL_PORT_MONITOR.println(sizeof(ExtendedZoneManager));
SERIAL_PORT_MONITOR.print(F(" sizeof(ExtendedZoneProcessor::Transition): "));
SERIAL_PORT_MONITOR.println(sizeof(ExtendedZoneProcessor::Transition));
SERIAL_PORT_MONITOR.print(
F(" sizeof(ExtendedZoneProcessor::TransitionStorage): "));
SERIAL_PORT_MONITOR.println(sizeof(ExtendedZoneProcessor::TransitionStorage));
SERIAL_PORT_MONITOR.print(
F(" sizeof(ExtendedZoneProcessor::MatchingEra): "));
SERIAL_PORT_MONITOR.println(sizeof(ExtendedZoneProcessor::MatchingEra));
// Complete
SERIAL_PORT_MONITOR.println(F("Complete:"));
SERIAL_PORT_MONITOR.print(F(" sizeof(complete::Info::ZoneContext): "));
SERIAL_PORT_MONITOR.println(sizeof(complete::Info::ZoneContext));
SERIAL_PORT_MONITOR.print(F(" sizeof(complete::Info::ZoneEra): "));
SERIAL_PORT_MONITOR.println(sizeof(complete::Info::ZoneEra));
SERIAL_PORT_MONITOR.print(F(" sizeof(complete::Info::ZoneInfo): "));
SERIAL_PORT_MONITOR.println(sizeof(complete::Info::ZoneInfo));
SERIAL_PORT_MONITOR.print(F(" sizeof(complete::Info::ZoneRule): "));
SERIAL_PORT_MONITOR.println(sizeof(complete::Info::ZoneRule));
SERIAL_PORT_MONITOR.print(F(" sizeof(complete::Info::ZonePolicy): "));
SERIAL_PORT_MONITOR.println(sizeof(complete::Info::ZonePolicy));
SERIAL_PORT_MONITOR.print(F(" sizeof(complete::ZoneRegistrar): "));
SERIAL_PORT_MONITOR.println(sizeof(complete::ZoneRegistrar));
SERIAL_PORT_MONITOR.print(F(" sizeof(CompleteZoneProcessor): "));
SERIAL_PORT_MONITOR.println(sizeof(CompleteZoneProcessor));
SERIAL_PORT_MONITOR.print(F(" sizeof(CompleteZoneProcessorCache<1>): "));
SERIAL_PORT_MONITOR.println(sizeof(CompleteZoneProcessorCache<1>));
SERIAL_PORT_MONITOR.print(F(" sizeof(CompleteZoneManager): "));
SERIAL_PORT_MONITOR.println(sizeof(CompleteZoneManager));
SERIAL_PORT_MONITOR.print(F(" sizeof(CompleteZoneProcessor::Transition): "));
SERIAL_PORT_MONITOR.println(sizeof(CompleteZoneProcessor::Transition));
SERIAL_PORT_MONITOR.print(
F(" sizeof(CompleteZoneProcessor::TransitionStorage): "));
SERIAL_PORT_MONITOR.println(sizeof(CompleteZoneProcessor::TransitionStorage));
SERIAL_PORT_MONITOR.print(
F(" sizeof(CompleteZoneProcessor::MatchingEra): "));
SERIAL_PORT_MONITOR.println(sizeof(CompleteZoneProcessor::MatchingEra));
// ace_time::basic and ace_time::extended classes
SERIAL_PORT_MONITOR.println(F("BENCHMARKS"));
runBenchmarks();
SERIAL_PORT_MONITOR.println(F("END"));
#if defined(EPOXY_DUINO)
exit(0);
#endif
}
void loop() {
}