Blender V4.3
TimeUtils.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include <time.h>
13
14#ifdef WITH_CXX_GUARDEDALLOC
15# include "MEM_guardedalloc.h"
16#endif
17
18namespace Freestyle {
19
21 public:
22 inline Chronometer() {}
23 inline ~Chronometer() {}
24
25 inline clock_t start()
26 {
27 _start = clock();
28 return _start;
29 }
30
31 inline double stop()
32 {
33 clock_t stop = clock();
34 return (double)(stop - _start) / CLOCKS_PER_SEC;
35 }
36
37 private:
38 clock_t _start;
39
40#ifdef WITH_CXX_GUARDEDALLOC
41 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Chronometer")
42#endif
43};
44
45} /* namespace Freestyle */
Read Guarded memory(de)allocation.
inherits from class Rep
Definition AppCanvas.cpp:20