Translations of this page:
 
Table of Contents

stats

About

stats is small, open source (LGPL), C++ code statistic library (code events counter).

Documentation

Documentation is included in source file.

Example code:

#include <stats.hpp>
//...
//declare events (this declare some objects):
STATS_DECL_EVENT(MyEvent, std::cout)		//root event, print raport to std::cout
STATS_DECL_SUBEVENT(MyEvent, SubEvt1) 		//MyEvent sub-event
STATS_DECL_SUBEVENT(MyEvent, SubEvt2)		//MyEvent sub-event
STATS_DECL_SUBEVENT(SubEvt2, SubEvt2SubEvt)	//SubEvt2 sub-event
//...
//in code just show where events/sub-events starts:
STATS_EVENT(MyEvent); //MyEvent starts hare
while (...) { //loop with MyEvent sub-events:
   if (...) {
     STATS_EVENT(SubEvt1); //SubEvt1 starts hare
     //...
   } else {
     STATS_EVENT(SubEvt2); //SubEvt2 starts hare
     //...
     while (...) { //loop with SubEvt2 sub-events:
        STATS_EVENT(SubEvt2SubEvt);
        //...
     }
   }
}

Download

 
en/project/stats.txt · Last modified: 2013/03/13 22:36 by Piotr Beling     Back to top