Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tests/bitarithm_timings: shorten timeout from 5s to 200ms #18894

Merged
merged 1 commit into from
Nov 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/bitarithm_timings/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down