27 for (
int i = 0; i <
count / 2; i++) {
37 for (
int i = 0; i <
count; i++)
38 result += chTimeNow();
42 efiPrintf(
"Finished %d iterations of 'chTimeNow()' in %dms",
count, time);
46 for (
int i = 0; i <
count; i++) {
49 result += chTimeNow();
56 efiPrintf(
"Finished %d iterations of 'chTimeNow()' with chSysLock in %dms",
count, time);
60 for (
int i = 0; i <
count; i++)
64 efiPrintf(
"Finished %d iterations of 'getTimeNowMs' in %dms",
count, time);
77 efiPrintf(
"Finished %d iterations of getBaseFuel in %dms",
count, time);
87 for (
int i = 0; i <
count; i++) {
93 efiPrintf(
"Finished %d iterations of updateSlowSensors in %dms",
count, time);
101 for (int64_t i = 0; i <
count; i++) {
106 efiPrintf(
"Finished %d iterations of int64_t summation in %dms",
count, time);
111 for (int64_t i = 0; i <
count; i++) {
116 efiPrintf(
"Finished %d iterations of int64_t multiplication in %dms",
count, time);
120 for (
int i = 0; i <
count; i++)
123 efiPrintf(
"Finished %d iterations of empty loop in %dms",
count, time);
127 for (
int i = 0; i <
count; i++) {
135 efiPrintf(
"Finished %d iterations of uint32_t summation in %dms",
count, time);
140 for (
int i = 0; i <
count; i++) {
141 tempi += (tempi + 100) / 130;
146 efiPrintf(
"Finished %d iterations of uint32_t division in %dms",
count, time);
151 for (
int i = 0; i <
count; i++) {
157 efiPrintf(
"Finished %d iterations of int64_t summation in %dms",
count, time);
162 for (
int i = 0; i <
count; i++) {
163 temp64 += (temp64 + 100) / 130;
168 efiPrintf(
"Finished %d iterations of int64_t division in %dms",
count, time);
173 for (
int i = 0; i <
count; i++) {
178 efiPrintf(
"Finished %d iterations of float summation in %dms",
count, time);
183 for (
int i = 0; i <
count; i++) {
184 tempf += tempf * 130.0f;
191 efiPrintf(
"Finished %d iterations of float multiplication in %dms",
count, time);
196 for (
int i = 0; i <
count; i++) {
197 tempf += (tempf + 100) / 130.0;
204 efiPrintf(
"Finished %d iterations of float division in %dms",
count, time);
209 for (
int i = 0; i <
count; i++) {
210 tempf += logf(tempf);
215 efiPrintf(
"Finished %d iterations of float log in %dms",
count, time);
220 for (
int i = 0; i <
count; i++)
225 efiPrintf(
"Finished %d iterations of double summation in %dms",
count, time);
230 for (
int i = 0; i <
count; i++)
231 tempd += (tempd + 100) / 130.0;
235 efiPrintf(
"Finished %d iterations of double division in %dms",
count, time);
240 for (
int i = 0; i <
count; i++) {
246 efiPrintf(
"Finished %d iterations of double log in %dms",
count, time);
251 efiPrintf(
"Running tests: %d",
count);
257extern Overflow64Counter
halTime;
266 efiPrintf(
"chTimeNow as seconds = %d",
getTimeNowS());
267 efiPrintf(
"hal seconds = %d",
halTime.get() / (
long)STM32_SYSCLK);
271 efiPrintf(
"unix seconds = %d", unix);
276 print(
"EFI_SHAFT_POSITION_INPUT=%d\r\n", EFI_SHAFT_POSITION_INPUT);
277 print(
"EFI_EMULATE_POSITION_SENSORS=%d\r\n", EFI_EMULATE_POSITION_SENSORS);
278 print(
"EFI_ANALOG_SENSORS=%d\r\n", EFI_ANALOG_SENSORS);
279 print(
"EFI_INTERNAL_ADC=%d\r\n", EFI_INTERNAL_ADC);
280 print(
"EFI_MAP_AVERAGING=%d\r\n", EFI_MAP_AVERAGING);
281 print(
"EFI_LOGIC_ANALYZER=%d\r\n", EFI_LOGIC_ANALYZER);
282 print(
"EFI_ENGINE_SNIFFER=%d\r\n", EFI_ENGINE_SNIFFER);
283 print(
"EFI_SHAFT_POSITION_INPUT=%d\r\n", EFI_SHAFT_POSITION_INPUT);
284 print(
"EFI_ENGINE_CONTROL=%d\r\n", EFI_ENGINE_CONTROL);
285 print(
"CH_DBG_SYSTEM_STATE_CHECK=%d\r\n", CH_DBG_SYSTEM_STATE_CHECK);
286 print(
"CH_DBG_ENABLE_CHECKS=%d\r\n", CH_DBG_ENABLE_CHECKS);
287 print(
"CH_DBG_ENABLE_ASSERTS=%d\r\n", CH_DBG_ENABLE_ASSERTS);
288 print(
"CH_DBG_ENABLE_STACK_CHECK=%d\r\n", CH_DBG_ENABLE_STACK_CHECK);
289 print(
"CH_DBG_THREADS_PROFILING=%d\r\n", CH_DBG_THREADS_PROFILING);
void addConsoleAction(const char *token, Void callback)
Register console action without parameters.
void addConsoleActionI(const char *token, VoidInt callback)
Register a console command with one Integer parameter.
Console package entry point header.
efitimesec_t getTimeNowS()
Current system time in seconds (32 bits)
efitimems_t getTimeNowMs()
Returns the 32 bit number of milliseconds since the board initialization.
msg_t TestThread(void *p)
Test execution thread function.
static void testSystemCalls(const int count)
static void testRusefiMethods(const int count)
Overflow64Counter halTime
static void runTests(const int count)
static void testMath(const int count)
static void runChibioTest()
void initTimePerfActions()