2
// Copyright (C) 2006-2011 Tobias Sargeant (tobias.sargeant@gmail.com).
3
// All rights reserved.
5
// This file is part of the Carve CSG Library (http://carve-csg.com/)
7
// This file may be used under the terms of the GNU General Public
8
// License version 2.0 as published by the Free Software Foundation
9
// and appearing in the file LICENSE.GPL2 included in the packaging of
12
// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
13
// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
14
// A PARTICULAR PURPOSE.
20
#include <carve/carve.hpp>
22
#ifndef CARVE_USE_TIMINGS
23
#define CARVE_USE_TIMINGS 0
32
TimingName(const char *name);
39
* Starts timing at the end of this constructor, using the given ID. To
40
* associate an ID with a textual name, use Timing::registerID.
43
TimingBlock(const TimingName &name);
51
* Starts timing against a particular ID.
53
static void start(int id);
55
static void start(const TimingName &id) {
60
* Stops the most recent timing block.
65
* This will print out the current state of recorded time blocks. It will
66
* display the tree of timings, as well as the summaries down the bottom.
68
static void printTimings();
71
* Associates a particular ID with a text string. This is used when
72
* printing out the timings.
74
static void registerID(int id, const char *name);
81
TimingName(const char *) {}
84
TimingBlock(int /* id */) {}
85
TimingBlock(const TimingName & /* name */) {}
88
static void start(int /* id */) {}
89
static void start(const TimingName & /* id */) {}
90
static double stop() { return 0; }
91
static void printTimings() {}
92
static void registerID(int /* id */, const char * /* name */) {}