1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18894 from kaspar030/shorten_bitarithm_timings_runtime

tests/bitarithm_timings: shorten timeout from 5s to 200ms
This commit is contained in:
Marian Buschsieweke 2022-11-12 12:26:40 +01:00 committed by GitHub
commit 4e00c0e360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,8 +37,8 @@
#include "test_utils/expect.h"
#include "xtimer.h"
#define TIMEOUT_S (5ul)
#define TIMEOUT (TIMEOUT_S * US_PER_SEC)
#define TIMEOUT_MS (200ul)
#define TIMEOUT (TIMEOUT_MS * US_PER_MS)
#define PER_ITERATION (4)
#if ARCH_32_BIT
@ -91,7 +91,7 @@ static void run_test(const char *name, unsigned (*test)(unsigned))
++count;
} while (atomic_load(&done) == false);
printf("+ %s: %lu iterations per second\r\n", name, (4*PER_ITERATION) * count / TIMEOUT_S);
printf("+ %s: %lu iterations per second\r\n", name, (4*PER_ITERATION) * count / TIMEOUT_MS * 1000);
}
static unsigned do_test_and_clear(unsigned state)
@ -121,7 +121,7 @@ static void run_test_test_and_clear(void)
++count;
} while (atomic_load(&done) == false);
printf("+ %s: %lu iterations per second\r\n", "bitarithm_test_and_clear", 2 * count / TIMEOUT_S);
printf("+ %s: %lu iterations per second\r\n", "bitarithm_test_and_clear", 2 * count / TIMEOUT_MS * 1000);
}
#define run_test(test) run_test(#test, test)