Blender V5.3
time_it.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11
12#pragma once
13
14#include <chrono>
15
17
18struct TimeIt {
19 using Duration = std::chrono::microseconds;
20
22 std::chrono::high_resolution_clock::time_point start;
23
25 {
26 start = std::chrono::high_resolution_clock::now();
27 }
29 {
30 auto end = std::chrono::high_resolution_clock::now();
31 time = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
32 }
33};
34
35} // namespace blender::gpu::shader::parser
std::chrono::high_resolution_clock::time_point start
Definition time_it.hh:22
std::chrono::microseconds Duration
Definition time_it.hh:19