1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 15:31:17 +01:00

bench_msg_pingpong: Add number of clock ticks per cycle

This commit is contained in:
Koen Zandberg 2020-07-30 21:47:55 +02:00
parent 9adc79f91a
commit cf56a2c2f4
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 "msg.h"
@ -75,7 +76,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__":