MaterialX 1.38.2
Timer.h
Go to the documentation of this file.
1//
2// TM & (c) 2021 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3// All rights reserved. See LICENSE.txt for license.
4//
5
6#ifndef MATERIALX_TIMER_H
7#define MATERIALX_TIMER_H
8
11
13
14#include <chrono>
15
16namespace MaterialX
17{
18
21class MX_RENDER_API ScopedTimer
22{
23 public:
24 using clock = std::chrono::high_resolution_clock;
25
26 ScopedTimer(double* externalCounter = nullptr);
28
30 double elapsedTime();
31
33 void startTimer();
34
36 void endTimer();
37
38 protected:
39 bool _active;
40 double* _externalCounter;
41 std::chrono::time_point<clock> _startTime;
42};
43
44} // namespace MaterialX
45
46#endif
Macros for declaring imported and exported symbols.
A class for scoped event timing.
Definition: Timer.h:22