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
11namespace triqs {
12
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
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
A utility class for measuring the execution time of a scope.