LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Stopwatch.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef STOPWATCH_H_6014714286
16#define STOPWATCH_H_6014714286
17
23#include <LibCarna/LibCarna.hpp>
24
25namespace LibCarna
26{
27
28namespace base
29{
30
31
32
33// ----------------------------------------------------------------------------------
34// Stopwatch
35// ----------------------------------------------------------------------------------
36
43class LIBCARNA Stopwatch
44{
45
47
48 double time0;
49
50public:
51
56
60 void restart();
61
65 double result() const;
66
67}; // Stopwatch
68
69
70
71} // namespace LibCarna :: base
72
73} // namespace LibCarna
74
75#endif // STOPWATCH_H_6014714286
Contains forward-declarations.
Implements stopwatch using the robust wallclock time from OMP that most compilers support.
Definition Stopwatch.hpp:44
double result() const
Tells result in seconds from current time measurement.
void restart()
Restarts the time measurement.
Stopwatch()
Starts the time measurement.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.