VR-Forces 4.5 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
features
scopeTimer.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2013 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
9
10
#include <tbb/tick_count.h>
11
#include <boost/noncopyable.hpp>
12
#include <vlutil/vlPrint.h>
13
#include <string>
14
21
#include <
features/featuresDefines.h
>
22
class
DT_DLL_features
DtScopeTimer
: boost::noncopyable
23
{
24
public
:
28
DtScopeTimer
(
const
std::string& text, std::ostream& str = DtWarn)
29
: myStream(str)
30
, myText(text)
31
, myStart(tbb::tick_count::now())
32
{
33
}
34
35
std::string& text()
36
{
37
return
myText;
38
}
39
40
~
DtScopeTimer
()
41
{
42
double
d = (tbb::tick_count::now() - myStart).seconds();
43
myStream << myText <<
" took "
<< d <<
" seconds"
<< std::endl;
44
}
45
46
private
:
47
std::ostream&
myStream
;
48
std::string
myText
;
49
tbb::tick_count
myStart
;
50
};
Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)