I need to put out a double value into an file. So for all my other string i have to put out i use fputs because i think and timed it that fputs is faster then fprintf.
但是,如果想阐明双重价值,那么就能够用手法来做,这样就尝试了print。 这非常缓慢。 我需要更多的时间,才能取代印本,并用数字(TEST)文档;
怎么能够像扼杀那样迅速翻开两番。 是否需要首先将其转化为扼杀?
我发现有些转换。 但是,如果使用这些产品,那么使用这些产品的速度就很慢。
那么,如果把双双双双 the放在档案中,怎么能够如此迅速?
fputs("TEST",fileout); //FAST
fprintf(fileout, "%f",p); //SLOW
EDIT:
印有两倍的时段:
END.PROCESSING.DATA: 2013-04-26 08:10:33.000
END.CALC.IN.FILE: 2013-04-26 08:11:13.000
• 时段:
END.PROCESSING.DATA: 2013-04-26 08:14:10.000
END.CALC.IN.FILE: 2013-04-26 08:14:37.000
当时的法律:
now = time (0);
strftime (buff, 100, "%Y-%m-%d %H:%M:%S.000", localtime (&now));
printf ("END.PROCESSING.DATA: %s
", buff);
//output file
FILE *fileout;
fileout = fopen("out.txt","w");
double p;
for(i=0; i<17000;i++){
for(j=0; j<i;j++){
for(z=0;z<400;z++){
//DO SOME WORK
}
p = 1.0;
fputs(allsubsts[i],fileout);
fputs(";",fileout);
fputs(allsubsts[j],fileout);
fputs(";",fileout);
//fprintf(fileout, "%.21g", p);
fputs("TEST",fileout);
fputs(";
",fileout);
}
}
fclose(fileout);
now = time(0);
strftime(buff,100,"%Y-%m-%d %H:%M:%S.000", localtime(&now));
printf("END.CALC.IN.FILE: %s
",buff);
Changes between the time are only the change that i put the double instead the TEST string in the file.