TRIQS/triqs_modest
3.3.0
Brillouin zone summation
Loading...
Searching...
No Matches
scoped_timer.hpp
Go to the documentation of this file.
1
// Copyright (c) 2025--present, The Simons Foundation
2
// This file is part of TRIQS/modest and is licensed under the terms of GPLv3 or later.
3
// SPDX-License-Identifier: GPL-3.0-or-later
4
// See LICENSE in the root of this distribution for details.
5
6
#pragma once
7
8
#include <chrono>
9
#include <iostream>
10
11
namespace
triqs
{
12
30
class
scoped_timer
{
31
std::chrono::time_point<std::chrono::high_resolution_clock> start;
32
33
public
:
34
scoped_timer
() : start(std::chrono::high_resolution_clock::now()) {}
35
36
~scoped_timer
() {
37
auto
end = std::chrono::high_resolution_clock::now();
38
std::chrono::duration<double> elapsed = end - start;
39
std::cerr <<
"Execution time: "
<< elapsed.count() <<
" seconds\n"
;
40
}
41
};
42
}
// namespace triqs
triqs::scoped_timer
A utility class for measuring the execution time of a scope.
Definition
scoped_timer.hpp:30
triqs::scoped_timer::~scoped_timer
~scoped_timer()
Definition
scoped_timer.hpp:36
triqs::scoped_timer::scoped_timer
scoped_timer()
Definition
scoped_timer.hpp:34
triqs
Definition
streams.hpp:11
triqs_modest
utils
scoped_timer.hpp
Generated by
1.9.8