void TDJ::DrawDX(HDC hdc,short*hDaoXing,mu *hBaoWen,int z)
{
int sn,sn1,sn2,sn3,n=0,n1=0,flag=0,fBS,js;
short r,x1,y1,x2,y2,*h,*h1,xxw,xx,color;
double wtime=0;
float v,s=10;
String wrh1;
time_t first,second;
clock_t start,end;
switch(xx)
{
case XX_JJ:
if(sn){color=YS_RED;
ofstream myf("zyname.txt",ios::app);
if(z==0&&n==0&&wr1==1){
start=clock(); wr1=0;
}
if(z==1&&n==0&&wr1==0&&wr2==1)
{
end=clock();
myf<<"end="<<end<<"\n"; wr2=0;
wtime=(end-start)/CLOCKS_PER_SEC;
myf<<"wtime="<<wtime;
v=s/wtime;
myf<<"V="<<v<<"\n";
//现在我得到时间差wtime,得到v ,写到文件中都对,但我在将它写在屏幕上就不对,我实在不知为什么了
Canvas->TextOut(500,90,"v="+FloatToStr(v)+" !");
// wrh1=FloatToStr(v)+"Km/s";
// wrh1=Str(v)+"Km/s";
// myf<<"wrh1";
myf.close(); } }
else {color=YS_BLUE;
if(z==0&&n==0&&xxw==32)//sjg 440
{color=YS_WHITE;wr1=1;}
if(z==1&&n==0&&xxw==32)//sazjg 452
{color=YS_WHITE;wr2=1;}
}
xxw++;xxw++;break;
default:TextOut(hdc,400,400,"Error Daoxing",20);break;
}
n1=xxw%8;
hup=hBaoWen+xxw/8;
}
}
}