00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef BENCHER_HH
00022 # define BENCHER_HH
00023 
00024 # include <vector>
00025 # include <iostream>
00026 
00027 # include <vaucanson/misc/timer.hh>
00028 
00029 NAMESPACE_VCSN_BEGIN
00030 
00031 namespace misc
00032 {
00033   class Bencher
00034   {
00035   public:
00037     void push (const Timer& t);
00038 
00040     std::ostream& print (std::ostream& o) const;
00041 
00042     void plot (std::ostream& o) const;
00043 
00045     Timer sum() const;
00046 
00048     Timer mean() const;
00049 
00051     Timer min() const;
00052 
00054     Timer max() const;
00055 
00056   private:
00058     Timer prepare (Timer t) const;
00059 
00061     std::vector<Timer> timers_;
00062   };
00063 
00064 
00066   std::ostream& operator<< (std::ostream& o, const Bencher& t);
00067 }
00068 
00069 NAMESPACE_VCSN_END
00070 
00071 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00072 #  include <vaucanson/misc/bencher.hxx>
00073 #  if VAUCANSON
00074 #   include <vaucanson/misc/bencher.cc>
00075 #  endif
00076 # endif // VCSN_USE_INTERFACE_ONLY
00077 
00078 #endif // !BENCHER_HH