Testbench for FastIO

Dependencies:   FastIO mbed

Fork of FastIO by Igor Skochinsky

Files at this revision

API Documentation at this revision

Comitter:
Sissors
Date:
Sat Jul 05 18:10:56 2014 +0000
Parent:
6:8ad8f8acd0a5
Commit message:
Added time in ns

Changed in this revision

FastIO.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/FastIO.lib	Wed Jul 02 06:02:25 2014 +0000
+++ b/FastIO.lib	Sat Jul 05 18:10:56 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Sissors/code/FastIO/#85a4a54f15e3
+http://mbed.org/users/Sissors/code/FastIO/#1a6ed4b84590
--- 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() {
--- a/mbed.bld	Wed Jul 02 06:02:25 2014 +0000
+++ b/mbed.bld	Sat Jul 05 18:10:56 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file