Finite Volume Solver
prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
include
fub
ext
Timer.hpp
Go to the documentation of this file.
1
//
2
// Created by Patrick Denzler on 10.10.19.
3
//
4
5
#ifndef FUB_EXT_TIMER_HPP
6
#define FUB_EXT_TIMER_HPP
7
8
#include <chrono>
9
#include <functional>
10
#include <string>
11
12
namespace
fub
{
13
14
class
Timer
{
15
public
:
16
Timer
(String name);
17
void
Start
();
18
void
Stop
();
19
void
Measure
(F&&
function
, Args&&... args);
20
void
Print
();
21
22
private
:
23
String
name_
;
24
std::chrono::time_point
start_time_
;
25
std::chrono::time_point
stop_time_
;
26
};
27
28
template
<
typename
F,
typename
... Args>
29
void
Timer::Measure
(F&&
function
, Args&&... args) {
30
this->
Start
();
31
std::invoke(
function
, args...);
32
this->
Stop
();
33
}
34
35
}
// namespace fub
36
37
#endif
// FUB_EXT_TIMER_HPP
fub::Timer
Definition:
Timer.hpp:14
fub::Timer::Measure
void Measure(F &&function, Args &&... args)
Definition:
Timer.hpp:29
fub::Timer::Timer
Timer(String name)
fub::Timer::stop_time_
std::chrono::time_point stop_time_
Definition:
Timer.hpp:25
fub::Timer::Print
void Print()
fub::Timer::Stop
void Stop()
fub::Timer::name_
String name_
Definition:
Timer.hpp:23
fub::Timer::start_time_
std::chrono::time_point start_time_
Definition:
Timer.hpp:24
fub::Timer::Start
void Start()
fub
The fub namespace.
Definition:
AnyBoundaryCondition.hpp:31
Generated on Fri Feb 12 2021 07:45:54 for Finite Volume Solver by
1.9.1