Changeset 114 for trunk/Softwares/Dhrystone/src/c
- Timestamp:
- Apr 17, 2009, 12:35:37 AM (16 years ago)
- Location:
- trunk/Softwares/Dhrystone/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Softwares/Dhrystone/src/c/dhry21a.c
r112 r114 255 255 User_Time = End_Time - Begin_Time; 256 256 257 if (User_Time < Too_Small_Time) 257 // if (User_Time < Too_Small_Time) 258 // { 259 //#ifdef HAVE_DOUBLE 260 // printf ("Measured time too small to obtain meaningful results : %f\n",User_Time); 261 //#else 262 // printf ("Measured time too small to obtain meaningful results : %d\n",User_Time); 263 //#endif 264 // printf ("Please increase number of runs\n"); 265 // printf ("\n"); 266 // } 267 // else 258 268 { 259 printf ("Measured time too small to obtain meaningful results : %f\n",User_Time); 260 printf ("Please increase number of runs\n"); 261 printf ("\n"); 262 } 263 else 264 { 269 #ifdef HAVE_DOUBLE 265 270 Microseconds = User_Time * Mic_secs_Per_Second / (DOUBLE) Number_Of_Runs; 266 271 Dhrystones_Per_Second = (DOUBLE) Number_Of_Runs / User_Time; 267 272 Vax_Mips = Dhrystones_Per_Second / 1757.0; 273 #else 274 Microseconds = User_Time / (DOUBLE) Number_Of_Runs; 275 #endif 268 276 269 277 #ifdef ROPT … … 274 282 #endif 275 283 284 #ifdef HAVE_DOUBLE 276 285 printf ("Microseconds for one run through Dhrystone : %.1lf \n",Microseconds); 277 286 printf ("Dhrystones per Second : %.1lf \n",Dhrystones_Per_Second); 278 287 printf ("VAX MIPS rating : %.3lf \n",Vax_Mips); 288 #else 289 printf ("Begin_Time : %d\n",Begin_Time); 290 printf ("End_Time : %d\n",End_Time ); 291 printf ("User_Time : %d\n",User_Time ); 292 printf ("Numbers of cycle for one run through Dhrystone : %d \n",Microseconds); 293 #endif 279 294 printf ("\n"); 280 295 … … 283 298 fprintf(Ap,"%s\n",Reg_Define); 284 299 300 #ifdef HAVE_DOUBLE 285 301 fprintf(Ap,"Microseconds for one loop : %.1lf\n",Microseconds); 286 302 fprintf(Ap,"Dhrystones per second : %.1lf\n",Dhrystones_Per_Second); 287 303 fprintf(Ap,"VAX MIPS rating : %.3lf\n",Vax_Mips); 304 #else 305 fprintf(Ap,"Numbers of cycle for one loop : %.1d\n",Microseconds); 306 #endif 288 307 } 289 308 fclose(Ap); 290 309 return 0; 291 292 310 } 293 311 -
trunk/Softwares/Dhrystone/src/c/dtime.c
r112 r114 65 65 66 66 #ifndef MHZ 67 #define MHZ (1000000 )67 #define MHZ (1000000.0) 68 68 #endif //!MHZ 69 69 … … 72 72 #endif //!FRQ 73 73 74 #ifndef DOUBLE75 #define double76 #endif77 78 74 DOUBLE dtime() 79 75 { 80 76 DOUBLE q; 81 77 82 /* q = (DOUBLE)(my_times())/(DOUBLE)FRQ; */ 78 #ifdef HAVE_DOUBLE 79 q = (DOUBLE)(my_times())/(DOUBLE)FRQ; 80 #else 83 81 q = (DOUBLE)(my_times()); 84 82 #endif 83 85 84 return (q); 86 85 } -
trunk/Softwares/Dhrystone/src/c/main.c
r112 r114 12 12 int main() 13 13 { 14 printf("cycle : %f\n",dtime()); 15 16 /* dhry21(100); */ 17 18 14 dhry21(100); 15 19 16 exit (0); 20 17
Note: See TracChangeset
for help on using the changeset viewer.