TTK
Loading...
Searching...
No Matches
home
julien
Pro
git
github
ttk-tierny
core
base
common
Timer.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <chrono>
4
5
namespace
ttk
{
6
7
class
Timer
{
8
using
ClockType = std::chrono::steady_clock;
9
using
TimeType = std::chrono::time_point<ClockType>;
10
using
DiffType = std::chrono::duration<double>;
11
12
public
:
13
Timer
() =
default
;
14
15
inline
double
getElapsedTime
() {
16
const
auto
end = this->
getTimeStamp
();
17
const
DiffType diff = end -
start_
;
18
return
diff.count();
19
}
20
21
inline
void
reStart
() {
22
start_
= this->
getTimeStamp
();
23
}
24
25
protected
:
26
inline
TimeType
getTimeStamp
() {
27
return
ClockType::now();
28
}
29
30
TimeType
start_
{this->
getTimeStamp
()};
31
};
32
33
}
// namespace ttk
ttk::Timer
Definition:
Timer.h:7
ttk::Timer::getTimeStamp
TimeType getTimeStamp()
Definition:
Timer.h:26
ttk::Timer::start_
TimeType start_
Definition:
Timer.h:30
ttk::Timer::reStart
void reStart()
Definition:
Timer.h:21
ttk::Timer::Timer
Timer()=default
ttk::Timer::getElapsedTime
double getElapsedTime()
Definition:
Timer.h:15
ttk
The Topology ToolKit.
Definition:
AbstractTriangulation.h:51
Generated on Tue Jul 11 2023 08:20:52 for TTK by
1.9.6