VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrfutil
performanceMonitor.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2015 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
6
#pragma once
7
#if 0
8
11
12
#include "
vrfutil/vrfutilDefines.h
"
13
14
#include <string>
15
#include <map>
16
17
#include <tbb/spin_mutex.h>
18
19
#ifdef WIN32
20
#include <BaseTsd.h>
21
#endif
22
23
class
DT_DLL_vrfutil
DtPerformanceMonitor
24
{
25
public
:
26
#ifdef WIN32
27
28
typedef
ULONG64 TimeStamp;
29
typedef
ULONG64 Duration;
30
#else
31
32
typedef
int
TimeStamp;
33
typedef
int
Duration;
34
#endif
35
36
class
DT_DLL_vrfutil
Context
37
{
38
public
:
39
static
Context
& Root();
40
41
Context
& operator[](std::string text);
42
43
void
add(Duration time);
44
45
protected
:
46
typedef
tbb::spin_mutex
Mutex
;
47
mutable
Mutex
myMutex;
48
49
typedef
std::map<std::string, Context> Map;
50
Map myMap;
51
};
52
53
explicit
DtPerformanceMonitor(
Context
&);
54
explicit
DtPerformanceMonitor(
const
std::string& label,
Context
* = 0);
55
56
~DtPerformanceMonitor();
57
58
59
void
stop();
60
61
protected
:
62
Context
& myContext;
63
TimeStamp myStartTime;
64
};
65
66
#define DtPERFORMANCE_CONTEXT(text) \
67
static DtPerformanceMonitor::Context& thePerfContext \
68
= DtPerformanceMonitor::Context::Root()[text]; \
69
DtPerformanceMonitor performanceMonitor(thePerfContext);
70
71
#endif
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)