hello
i have a program that is written by Borland C++Builder 6
it is a program for writing binary files using ofstream.
but when i ship this program to Borland C++Builder 2006/2007 and compile it,the run time of program increased very much.
for example you can test this standard code in both BCB 6 and BCB 2006 and see the resulted time.
the time of BCB 6 is very very better than BCB 2006
btw : i have used other methods such as windows API for writing the files but their time isn't as good as IOstreams time.
#include <fstream>
#include <iostream>
#include <DateUtils.hpp>
int n[100000];
for(int i=0; i<100000; i++)
n[i] = 1;
fstream out("test", ios::out | ios::binary);
if(!out) {
ShowMessage("Cannot open file.");
exit(0);
}
TTime t1=Time ();
out.write((char *) &n, sizeof n);
TTime t2=Time ();
ShowMessage( MilliSecondsBetween(t1,t2));
out.close();