+ wxPrintf("%ld lines done in %ldms = %gus/line\n",
+ opts.numLines, t, (1000. * t)/opts.numLines);
+ }
+
+
+ void BenchmarkRectangles(const char *msg, wxDC& dc)
+ {
+ if ( opts.mapMode != 0 )
+ dc.SetMapMode((wxMappingMode)opts.mapMode);
+ if ( opts.penWidth != 0 )
+ dc.SetPen(wxPen(*wxWHITE, opts.penWidth));
+
+ dc.SetBrush( *wxRED_BRUSH );
+
+ wxPrintf("Benchmarking %s DC: ", msg);
+
+ wxStopWatch sw;
+ for ( int n = 0; n < opts.numLines; n++ )
+ {
+ int x = rand() % opts.width,
+ y = rand() % opts.height;
+
+ dc.DrawRectangle(x, y, 32, 32);
+ }
+
+ const long t = sw.Time();
+
+ wxPrintf("%ld rects done in %ldms = %gus/rect\n",