// This version needs C preprocessor http://free.pages.at/filtermeister.html %ffp Author:"Guessous Mehdi." URL: "http://www.selwane.com/mehdi" Dialog:"Performance Test", size=(500,235), Drag = Background, gradient=(powderblue,yellowgreen,horizontal) ctl[CTL_OK]:invisible ctl[CTL_CANCEL]:PUSHBUTTON,text="Cancel",pos=(385,218),size=(40,14),val=0 ctl[50]:CHECKBOX(PUSHLIKE),text="Test",pos=(300,218),size=(40,14),action=preview ForEveryTile:{ //---------------------------------------- int loopTime=0; //time for the "for" loop int performance; int iter; int iterMax=30000000;//30 million of iterations for each test //---------------------------------------- double rt,d1,d2; double Pi=3.14159265359; double e1=2.71828182846; double *buff=malloc(8); int c; setCtlVal(50,0); #define Performance(Ctl,Name,Code) \ if (i0>=Ctl) { if (updateProgress(Ctl,i0)) abort(); \ setCtlText(Ctl,Name " = waiting..."); \ setCtlColor(Ctl,RGB(255,0,0)); \ performance=clock(); \ for(iter=0;itere1)) Performance2(18,if(456>123)) Performance(19,"switch",switch(5){case 5:break;case 6:break;}) Performance2(20,max(456,123)) Performance(23,"double --> int (implicit)",c=Pi) Performance(24,"(int)double",(int)Pi) Performance2(25,floor(Pi)) Performance(26,"(double)int",(double)456) Performance2(29,fabs(Pi)) Performance(30,"modula",456%123) Performance(31,"sum",Pi+e1) Performance(32,"multiplication",Pi*e1) Performance(33,"division int",c/123) Performance(34,"division double",Pi/e1) Performance2(37,fsin(e1)) Performance2(38,sin(e1)) Performance2(39,sqrt(e1)) Performance2(40,pow(e1,Pi)) free(buff); updateProgress(0,1); return true; }//end ForEveryTile