OSDN Git Service

2003-06-18 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / performance / ofstream_insert_float.cc
index 0fefdd4..549e203 100644 (file)
 // the GNU General Public License.
 
 #include <fstream>
+#include <testsuite_performance.h>
 
 // based on libstdc++/8761 poor fstream performance (converted to float)
 int main() 
 {
-  std::ofstream out("tmp_perf_float.txt");
-  for (int i = 0; i < 10000000; ++i)
+  using namespace std;
+  using namespace __gnu_cxx_test;
+
+  time_counter time;
+  resource_counter resource;
+  const int iterations = 10000000;
+
+  ofstream out("tmp_perf_float.txt");
+  start_counters(time, resource);
+  for (int i = 0; i < iterations; ++i)
     {
       float f = static_cast<float>(i);
       out << f << "\n";
     }
+  stop_counters(time, resource);
+  report_performance(__FILE__, "", time, resource);
+
   return 0;
 };