Avara3D 0.2.0
C++ API reference
ScopeTimer.h
1//
2// ScopeTimer.h
3// avara3d
4//
5// Created by Morgan Davis on 12/17/25.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_PROFILE_SCOPETIMER_H
10#define AVARA3D_PROFILE_SCOPETIMER_H
11
12#include <chrono>
13
14#include "a3d/profile/Profiler.h"
15
16namespace a3d {
17
18 class Profiler;
19
20 class ScopeTimer {
21
22 public:
23 // [Internal Lifecycle Functions]
24
25 ScopeTimer(Profiler& profiler, Profiler::Tag tag);
26
27 ScopeTimer(const ScopeTimer&) = delete;
28 ScopeTimer& operator=(const ScopeTimer&) = delete;
29
30 ScopeTimer(ScopeTimer&&) = delete;
31 ScopeTimer& operator=(ScopeTimer&&) = delete;
32
33 ~ScopeTimer();
34
35 private:
36 // [Private Member Variables]
37
38 Profiler* _profiler;
39 Profiler::Tag _tag;
40 std::chrono::time_point<std::chrono::steady_clock> _start;
41 };
42
43}
44
45#endif // AVARA3D_PROFILE_SCOPETIMER_H