1
0
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:
Koen Zandberg 2020-07-30 21:51:18 +02:00
parent cf56a2c2f4
commit f2a27dd46b
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
2 changed files with 8 additions and 2 deletions

View File

@ -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;
}

View File

@ -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__":