Index: lemon/time_measure.h
===================================================================
--- lemon/time_measure.h	(revision 1839)
+++ lemon/time_measure.h	(revision 1847)
@@ -18,5 +18,5 @@
 #define LEMON_TIME_MEASURE_H
 
-///\ingroup misc
+///\ingroup timecount
 ///\file
 ///\brief Tools for measuring cpu usage
@@ -30,5 +30,5 @@
 namespace lemon {
 
-  /// \addtogroup misc
+  /// \addtogroup timecount
   /// @{
 
@@ -210,5 +210,5 @@
   ///  doSomething();
   ///  std::cout << T << '\n';
-  ///  T.reset();
+  ///  T.restart();
   ///  doSomethingElse();
   ///  std::cout << T << '\n';
@@ -224,5 +224,6 @@
   ///
   ///\warning Depending on the operation system and its actual configuration
-  ///the time counters have a certain (relatively big) granularity.
+  ///the time counters have a certain (10ms on a typical Linux system)
+  ///granularity.
   ///Therefore this tool is not appropriate to measure very short times.
   ///Also, if you start and stop the timer very frequently, it could lead
@@ -239,9 +240,9 @@
   class Timer
   {
-    int running; //Timer is running iff running>0; (running>=0 always holds)
+    int _running; //Timer is running iff _running>0; (_running>=0 always holds)
     TimeStamp start_time; //This is the relativ start-time if the timer
-                          //is running, the collected running time otherwise.
-    
-    void _reset() {if(running) start_time.stamp(); else start_time.reset();}
+                          //is _running, the collected _running time otherwise.
+    
+    void _reset() {if(_running) start_time.stamp(); else start_time.reset();}
   
   public: 
@@ -250,5 +251,5 @@
     ///\param _running indicates whether or not the timer starts immediately.
     ///
-    Timer(bool _running=true) :running(_running) {_reset();}
+    Timer(bool run=true) :_running(run) {_reset();}
 
     ///Computes the ellapsed time
@@ -260,13 +261,14 @@
       TimeStamp t;
       t.stamp();
-      return running?t-start_time:start_time;
-    }
-
-    ///Resets the time counters
-
-    ///Resets the time counters
-    ///
+      return _running?t-start_time:start_time;
+    }
+
+    ///Reset and stop the time counters
+
+    ///This function resets and stops the time counters
+    ///\sa restart()
     void reset()
     {
+      _running=0;
       _reset();
     }
@@ -281,5 +283,5 @@
     void start() 
     {
-      if(running) running++;
+      if(_running) _running++;
       else {
 	TimeStamp t;
@@ -288,13 +290,20 @@
       }
     }
+
     
     ///Stop the time counters
 
-    ///This function stops the time counters.
-    ///
-    ///\sa stop()
+    ///This function stops the time counters. If start() was executed more than
+    ///once, then the same number of stop() execution is necessary the really
+    ///stop the timer.
+    /// 
+    ///\sa halt()
+    ///\sa start()
+    ///\sa restart()
+    ///\sa reset()
+
     void stop() 
     {
-      if(running && !--running) {
+      if(_running && !--_running) {
 	TimeStamp t;
 	t.stamp();
@@ -302,4 +311,44 @@
       }
     }
+
+    ///Halt (i.e stop immediately) the time counters
+
+    ///This function stops immediately the time counters.
+    ///
+    ///\sa stop()
+    ///\sa restart()
+    ///\sa reset()
+
+    void halt() 
+    {
+      if(_running) {
+	_running=0;
+	TimeStamp t;
+	t.stamp();
+	start_time=t-start_time;
+      }
+    }
+
+    ///Returns the running state of the timer
+
+    ///This function returns the number of stop() exections that is
+    ///necessary to really stop the timer.
+    ///For example the timer
+    ///is running if and only if the return value is \c true
+    ///(i.e. greater than
+    ///zero).
+    int running()  { return _running; }
+    
+    
+    ///Restart the time counters
+
+    ///This function is a shorthand for
+    ///a reset() and a start() calls.
+    ///
+    void restart() 
+    {
+      reset();
+      start();
+    }
     
     ///Gives back the ellapsed user time of the process
@@ -331,4 +380,23 @@
   };
 
+  ///Same as \ref Timer but prints a report on destruction.
+
+  ///Same as \ref Timer but prints a report on destruction.
+  ///\todo Untested
+  class TimeReport : public Timer 
+  {
+    std::string _title;
+    std::ostream &_os;
+  public:
+    ///\e
+    
+    TimeReport(std::string title,std::ostream &os,bool run) 
+      : Timer(run), _title(title), _os(os){}
+    ~TimeReport() 
+    {
+      _os << _title << this << std::endl;
+    }
+  };
+      
   ///Prints the time counters
 
