Testbench for FastIO

Dependencies:   FastIO mbed

Fork of FastIO by Igor Skochinsky

Revision:
7:b45620275f74
Parent:
5:8a7a7df0a9c7
--- a/main.cpp	Wed Jul 02 06:02:25 2014 +0000
+++ b/main.cpp	Sat Jul 05 18:10:56 2014 +0000
@@ -17,7 +17,7 @@
 void print_results(int digicount, int fastcount);
 
 int main() {
-    printf("\r\nAll numbers are the number of core clock cycles per IO operation\r\n");
+    printf("\r\nStarting test bench\r\n");
     
     basic_test();
     fixed_write();
@@ -32,7 +32,8 @@
 void print_results(int digicount, int fastcount) {
     float digicycles = (float)digicount / LOOPS * (float)SystemCoreClock / 1000000.0f;
     float fastcycles = (float)fastcount / LOOPS * (float)SystemCoreClock / 1000000.0f;
-    printf("Standard took %.1f cycles, FastIO took %.1f cycles, which is %d%%\r\n", digicycles, fastcycles,(int)(100.0f*fastcycles/digicycles + 0.5));
+    printf("Standard took %.2f cycles, FastIO took %.2f cycles, which is %d%%\r\n", digicycles, fastcycles,(int)(100.0f*fastcycles/digicycles + 0.5));
+    printf("Standard took %.0fns, FastIO took %.0fns\r\n", (float)digicount/LOOPS * 1000, (float)fastcount/LOOPS * 1000);
 }
  
 void basic_test() {