Assignments
Assignments
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
_
b
c
d
e
f
g
i
j
k
m
n
o
p
q
r
s
t
u
w
Functions
_
b
c
d
e
f
g
j
m
n
o
r
s
t
u
w
Variables
Typedefs
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Typedefs
Enumerations
Enumerator
Related Symbols
o
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
w
y
Variables
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
_
b
c
d
e
f
g
h
i
j
l
m
p
r
s
u
v
w
Enumerations
Enumerator
h
j
m
o
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
▼
Assignments
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
Assignments
►
GL
►
Image
►
JPEG
►
Ray
►
SVD
▼
Util
►
algebra.h
►
cmdLineParser.h
►
cmdLineParser.inl
►
exceptions.h
►
factory.h
geometry.cpp
►
geometry.h
►
geometry.inl
geometry.todo.cpp
geometry.todo.inl
interpolation.cpp
►
interpolation.h
interpolation.todo.inl
►
poly34.cpp
►
poly34.h
►
polynomial.h
►
polynomial.inl
►
ProgressBar.h
ProgressBar.inl
threads.cpp
►
threads.h
►
timer.h
►
main1.cpp
►
main2.cpp
►
main3.cpp
►
main4.cpp
►
File Members
timer.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2019, Michael Kazhdan
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or without modification,
6
are permitted provided that the following conditions are met:
7
8
Redistributions of source code must retain the above copyright notice, this list of
9
conditions and the following disclaimer. Redistributions in binary form must reproduce
10
the above copyright notice, this list of conditions and the following disclaimer
11
in the documentation and/or other materials provided with the distribution.
12
13
Neither the name of the Johns Hopkins University nor the names of its contributors
14
may be used to endorse or promote products derived from this software without specific
15
prior written permission.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
18
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
19
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
20
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26
DAMAGE.
27
*/
28
29
#ifndef TIMER_INCLUDED
30
#define TIMER_INCLUDED
31
32
#include <chrono>
33
namespace
Util
34
{
36
class
Timer
37
{
39
std::chrono::high_resolution_clock::time_point
_start
;
40
41
public
:
43
Timer
(
void
){
_start
= std::chrono::high_resolution_clock::now(); }
44
46
double
elapsed
(
void
)
const
47
{
48
std::chrono::high_resolution_clock::time_point now = std::chrono::high_resolution_clock::now();
49
std::chrono::duration< double > duration = std::chrono::duration_cast< std::chrono::duration< double > >( now -
_start
);
50
return
duration.count();
51
};
46
double
elapsed
(
void
)
const
{
…
}
52
54
void
reset
(
void
){
_start
= std::chrono::high_resolution_clock::now(); }
55
};
36
class
Timer
{
…
};
56
}
57
#endif
// TIMER_INCLUDED
Util::Timer
Definition
timer.h:37
Util::Timer::Timer
Timer(void)
Definition
timer.h:43
Util::Timer::elapsed
double elapsed(void) const
Definition
timer.h:46
Util::Timer::reset
void reset(void)
Definition
timer.h:54
Util::Timer::_start
std::chrono::high_resolution_clock::time_point _start
Definition
timer.h:39
Util
Definition
algebra.h:7
Assignments
Util
timer.h
Generated by
1.11.0