Blender V5.0
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
11
12#include <time.h>
13
14#include "MEM_guardedalloc.h"
15
16namespace Freestyle {
17
19 public:
20 inline Chronometer() {}
21 inline ~Chronometer() {}
22
23 inline clock_t start()
24 {
25 _start = clock();
26 return _start;
27 }
28
29 inline double stop()
30 {
31 clock_t stop = clock();
32 return (double)(stop - _start) / CLOCKS_PER_SEC;
33 }
34
35 private:
36 clock_t _start;
37
38 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Chronometer")
39};
40
41} /* namespace Freestyle */
Read Guarded memory(de)allocation.
inherits from class Rep
Definition AppCanvas.cpp:20