STIR 6.4.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*/
23
24#ifndef __stir_TIMER_H__
25#define __stir_TIMER_H__
26
27#include "stir/common.h"
28
29START_NAMESPACE_STIR
30
53class Timer
54{
55public:
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
69protected:
70 bool running;
71 double previous_value;
72 double previous_total_value;
73
74 virtual double get_current_value() const = 0;
75};
76
77END_NAMESPACE_STIR
78
79#include "stir/Timer.inl"
80
81#endif // __TIMER_H__
inline implementations for stir::Timer
void reset()
reset stopwatch
Definition Timer.inl:72
void start(bool do_reset=false)
start stopwatch, optionally resetting first
Definition Timer.inl:38
void stop()
stop stopwatch
Definition Timer.inl:52
double value() const
return value is undefined when start() is not called first.
Definition Timer.inl:79
basic configuration include file