bench_mutex_pingpong: Add number of clock ticks per cycle
This commit is contained in:
parent
f2a27dd46b
commit
86035661a3
@ -20,6 +20,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "macros/units.h"
|
||||
#include "mutex.h"
|
||||
#include "thread.h"
|
||||
#include "xtimer.h"
|
||||
@ -78,7 +79,12 @@ int main(void)
|
||||
n++;
|
||||
}
|
||||
|
||||
printf("{ \"result\" : %"PRIu32" }\n", n);
|
||||
printf("{ \"result\" : %"PRIu32, n);
|
||||
#ifdef CLOCK_CORECLOCK
|
||||
printf(", \"ticks\" : %"PRIu32,
|
||||
(uint32_t)((TEST_DURATION/US_PER_MS) * (CLOCK_CORECLOCK/KHZ(1)))/n);
|
||||
#endif
|
||||
puts(" }");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ from testrunner import run
|
||||
|
||||
|
||||
def testfunc(child):
|
||||
child.expect(r"{ \"result\" : \d+ }")
|
||||
child.expect(r"{ \"result\" : \d+(, \"ticks\" : \d+)? }")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user