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