Revision: 57167
          http://sourceforge.net/p/brlcad/code/57167
Author:   brlcad
Date:     2013-08-27 04:32:12 +0000 (Tue, 27 Aug 2013)
Log Message:
-----------
wrap the innocuous debug printing within #ifdefs with a simple trigger.  
probably worth having a bu routine to calculate h:m:s from a time delta.  
curiously encountered a regress-solids failure due to the GED_HELP return code 
making the draw call presssume it failed.

Modified Paths:
--------------
    brlcad/trunk/src/libged/draw.c

Modified: brlcad/trunk/src/libged/draw.c
===================================================================
--- brlcad/trunk/src/libged/draw.c      2013-08-27 03:17:10 UTC (rev 57166)
+++ brlcad/trunk/src/libged/draw.c      2013-08-27 04:32:12 UTC (rev 57167)
@@ -1589,8 +1589,13 @@
     int last_opt=0;
     struct bu_vls vls = BU_VLS_INIT_ZERO;
     static const char *usage = "<[-R -C#/#/# -s] objects> | <-o -A attribute 
name/value pairs>";
-    int64_t elapsetime;
 
+/* #define DEBUG_TIMING 1 */
+
+#ifdef DEBUG_TIMING
+    int64_t elapsedtime;
+#endif
+
     GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR);
     GED_CHECK_DRAWABLE(gedp, GED_ERROR);
     GED_CHECK_ARGC_GT_0(gedp, argc, GED_ERROR);
@@ -1604,7 +1609,10 @@
        return GED_HELP;
     }
 
-    elapsetime = bu_gettime();
+#ifdef DEBUG_TIMING
+    elapsedtime = bu_gettime();
+#endif
+
     /* skip past cmd */
     --argc;
     ++argv;
@@ -1772,19 +1780,21 @@
            _ged_drawtrees(gedp, argc, argv, kind, (struct _ged_client_data 
*)0);
        }
     }
-    elapsetime = bu_gettime() - elapsetime;
-       {
-           int seconds = elapsetime / 1000000;
-           int minutes = seconds / 60;
-           int hours = minutes / 60;
 
-           minutes = minutes % 60;
-           seconds = seconds %60;
+#ifdef DEBUG_TIMING
+    elapsedtime = bu_gettime() - elapsedtime;
+    {
+       int seconds = elapsedtime / 1000000;
+       int minutes = seconds / 60;
+       int hours = minutes / 60;
 
-           bu_vls_printf(gedp->ged_result_str, "Elapse time: 
%02d:%02d:%02d\n", hours, minutes,seconds);
-           return GED_HELP;
-       }
+       minutes = minutes % 60;
+       seconds = seconds %60;
 
+       bu_vls_printf(gedp->ged_result_str, "Elapsed time: %02d:%02d:%02d\n", 
hours, minutes, seconds);
+    }
+#endif
+
     return GED_OK;
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to