]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/SGPerfMon.cxx
Keep Linux happy.
[simgear.git] / simgear / structure / SGPerfMon.cxx
index 43fab6d2a9492b229bd40741aab8a1fe79a5cb06..ae8191b5a1278332a0bc92fa65c88f32a1ac9505 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 
 #ifdef HAVE_CONFIG_H
@@ -52,8 +52,6 @@ SGPerformanceMonitor::bind(void)
     _statiticsSubsystems = _root->getChild("subsystems",    0, true);
     _statisticsFlag      = _root->getChild("enabled",       0, true);
     _statisticsInterval  = _root->getChild("interval-s",    0, true);
-//    _statiticsMinJitter  = _root->getChild("min-jitter-ms", 0, true);
-//    _statiticsMinTime    = _root->getChild("min-time-ms",   0, true);
 }
 
 void
@@ -62,8 +60,6 @@ SGPerformanceMonitor::unbind(void)
     _statiticsSubsystems = 0;
     _statisticsFlag = 0;
     _statisticsInterval = 0;
-//    _statiticsMinJitter = 0;
-//    _statiticsMinTime = 0;
 }
 
 void
@@ -80,7 +76,10 @@ SGPerformanceMonitor::update(double dt)
         // flag has changed, update subsystem manager
         _isEnabled = _statisticsFlag->getBoolValue();
         if (_isEnabled)
+        {
             _subSysMgr->setReportTimingCb(this,&subSystemMgrHook);
+            _lastUpdate.stamp();
+        }
         else
             _subSysMgr->setReportTimingCb(this,0);
     }
@@ -110,12 +109,13 @@ SGPerformanceMonitor::reportTiming(const string& name, SampleStatistic* timeStat
 {
     SGPropertyNode* node = _statiticsSubsystems->getChild("subsystem",_count++,true);
 
-    double minMs    = timeStat->min()    / 1000;
-    double maxMs    = timeStat->max()    / 1000;
-    double meanMs   = timeStat->mean()   / 1000;
-    double stdDevMs = timeStat->stdDev() / 1000;
-    double totalMs  = timeStat->total()  / 1000;
-    int    samples  = timeStat->samples();
+    double minMs        = timeStat->min()    / 1000;
+    double maxMs        = timeStat->max()    / 1000;
+    double meanMs       = timeStat->mean()   / 1000;
+    double stdDevMs     = timeStat->stdDev() / 1000;
+    double totalMs      = timeStat->total()  / 1000;
+    double cumulativeMs = timeStat->cumulative() / 1000;
+    int    samples      = timeStat->samples();
 
     node->setStringValue("name", name);
     node->setDoubleValue("min-ms", minMs);
@@ -123,6 +123,7 @@ SGPerformanceMonitor::reportTiming(const string& name, SampleStatistic* timeStat
     node->setDoubleValue("mean-ms", meanMs);
     node->setDoubleValue("stddev-ms", stdDevMs);
     node->setDoubleValue("total-ms", totalMs);
+    node->setDoubleValue("cumulative-ms", cumulativeMs);
     node->setDoubleValue("count",samples);
 
     timeStat->reset();