Erik -
/
FastIO_TestBench
Testbench for FastIO
Fork of FastIO by
Diff: main.cpp
- Revision:
- 3:8d217a0bb245
- Parent:
- 1:8064f8b8cf82
- Child:
- 5:8a7a7df0a9c7
--- a/main.cpp Sat May 22 23:13:55 2010 +0000 +++ b/main.cpp Sat May 22 23:31:39 2010 +0000 @@ -8,6 +8,7 @@ FastOut<LED2> led2; PortOut ledport(Port0, LED_MASK); FastPortOut<Port0, LED_MASK> ledport2; +MaskedPortOut<Port0, LED_MASK> ledport3; Timer t; #define LOOPS 100000000 @@ -57,4 +58,16 @@ } t.stop(); printf("FastPortOut: %f seconds (%d ns per iteration).\n", t.read(), t.read_us()/(LOOPS/1000)); + + count = LOOPS; + t.reset(); + t.start(); + value = LED_MASK; + while ( count -- ) + { + ledport3 = value; + value ^= LED_MASK; + } + t.stop(); + printf("MaskedPortOut: %f seconds (%d ns per iteration).\n", t.read(), t.read_us()/(LOOPS/1000)); }