X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=performance_test.c;h=44b5b7be26b4db9183ea5f0962d0a8e81c74184d;hb=f58eb2f22289048ea43fd8124b912d653d3c646e;hp=0728827cf75a9f085c5b8c708901074fba9181ba;hpb=9e7453525f32441ea49ef1d9b3248e94d9554eec;p=avr-crypto-lib.git diff --git a/performance_test.c b/performance_test.c index 0728827..44b5b7b 100644 --- a/performance_test.c +++ b/performance_test.c @@ -7,10 +7,13 @@ **/ #include "config.h" +#include #include #include #include #include +#include +#include "uart.h" #include "performance_test.h" @@ -65,6 +68,27 @@ void getOverhead(uint16_t* constoh, uint16_t* intoh){ *intoh = int_overhead; } +void print_time_P(PGM_P s, uint64_t t){ + char sv[16]; + uint8_t c; + uart_putstr_P(PSTR("\r\n")); + uart_putstr_P(s); + ultoa((unsigned long)t, sv, 10); + for(c=strlen(sv); c<11; ++c){ + uart_putc(' '); + } + uart_putstr(sv); +} +void print_overhead(void){ + char str[16]; + uart_putstr_P(PSTR("\r\n\r\n=== benchmark ===")); + utoa(const_overhead, str, 10); + uart_putstr_P(PSTR("\r\n\tconst overhead: ")); + uart_putstr(str); + utoa(int_overhead, str, 10); + uart_putstr_P(PSTR("\r\n\tinterrupt overhead: ")); + uart_putstr(str); +}