Carna Version 3.3.3
Loading...
Searching...
No Matches
Stopwatch.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef STOPWATCH_H_6014714286
13#define STOPWATCH_H_6014714286
14
19#include <Carna/Carna.h>
20
21namespace Carna
22{
23
24namespace base
25{
26
27
28
29// ----------------------------------------------------------------------------------
30// Stopwatch
31// ----------------------------------------------------------------------------------
32
40class CARNA_LIB Stopwatch
41{
42
44
45 double time0;
46
47public:
48
53
57 void restart();
58
62 double result() const;
63
64}; // Stopwatch
65
66
67
68} // namespace Carna :: base
69
70} // namespace Carna
71
72#endif // STOPWATCH_H_6014714286
Implements stopwatch using the robust wallclock time from OMP that most compilers support.
Definition Stopwatch.h:41
Stopwatch()
Starts the time measurement.
double result() const
Tells result in seconds from current time measurement.
void restart()
Restarts the time measurement.
#define NON_COPYABLE
Features class it is placed in as non-copyable.