Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Dhrystone by
Revision 1:a4840e30d4a9, committed 2017-10-12
- Comitter:
- sral4054
- Date:
- Thu Oct 12 03:30:29 2017 +0000
- Parent:
- 0:f96b0b385ec4
- Commit message:
- Module 3_DMIPS ECEN 5803 Project 1; ; Submitted by; 1. Rahul Yamasani; 2. Srivishnuj Alvakonda;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r f96b0b385ec4 -r a4840e30d4a9 main.cpp --- a/main.cpp Fri Jun 13 18:30:37 2014 +0000 +++ b/main.cpp Thu Oct 12 03:30:29 2017 +0000 @@ -6,11 +6,11 @@ Serial pc(USBTX, USBRX); //serial channel over HDK USB interface int main() { - double benchtime, dps; + double benchtime, dps, VAX_DMIPS; unsigned long loops; pc.baud(9600); - printf("Dhrystone Benchmark Program C/1 12/01/84\r\n"); + pc.printf("Dhrystone Benchmark Program C/1 12/01/84\r\n"); timer.start(); while(1) { loops = 0l; @@ -18,14 +18,16 @@ timer.reset(); do { Proc0(); + Proc0(); loops += LOOPS; benchtime = timer.read(); - } while (benchtime <= 60.000); + } while (benchtime <= 20.000); myled = 0; dps = (double)loops / benchtime; - printf("Dhrystone time for %ld passes = %.3f sek\r\n", loops, benchtime); - printf("This machine benchmarks at %.0f dhrystones/second\r\n", dps); - + VAX_DMIPS = dps/1757.0; + pc.printf("Dhrystone time for %ld passes = %.3f sec\r\n", loops, benchtime); + pc.printf("This machine benchmarks at %.0f dhrystones/second\r\n", dps); + pc.printf("This machine has %.0f VAX DMIPS\r\n", VAX_DMIPS); wait(1.0); } }