STIR  6.2.0
Timer.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000 PARAPET partners
5  Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
6  Copyright (C) 2023, University College London
7  This file is part of STIR.
8 
9  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
10 
11  See STIR/LICENSE.txt for details
12 */
24 #ifndef __stir_TIMER_H__
25 #define __stir_TIMER_H__
26 
27 #include "stir/common.h"
28 
29 START_NAMESPACE_STIR
30 
53 class Timer
54 {
55 public:
56  inline Timer();
57  inline virtual ~Timer();
59 
60  inline void start(bool do_reset = false);
62  inline void stop();
64 
65  inline void reset();
67  inline double value() const;
68 
69 protected:
70  bool running;
71  double previous_value;
72  double previous_total_value;
73 
74  virtual double get_current_value() const = 0;
75 };
76 
77 END_NAMESPACE_STIR
78 
79 #include "stir/Timer.inl"
80 
81 #endif // __TIMER_H__
inline implementations for stir::Timer
basic configuration include file
A general base class for timers. Interface is like a stop watch.
Definition: Timer.h:53