Skip to content

Commit

Permalink
Merge pull request #18894 from kaspar030/shorten_bitarithm_timings_ru…
Browse files Browse the repository at this point in the history
…ntime

tests/bitarithm_timings: shorten timeout from 5s to 200ms
  • Loading branch information
maribu authored Nov 12, 2022
2 parents 01182af + 317e05b commit 4e00c0e
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 4e00c0e

Please sign in to comment.