mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
bench_sched_nop: Add number of clock ticks per cycle
This commit is contained in:
parent
cf56a2c2f4
commit
f2a27dd46b
@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "macros/units.h"
|
||||
#include "thread.h"
|
||||
|
||||
#include "xtimer.h"
|
||||
@ -51,7 +52,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…
Reference in New Issue
Block a user