Ice 3.7 C++98 API Reference
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
c
e
g
i
m
n
o
p
r
s
t
u
v
w
Variables
b
c
e
g
i
k
n
p
s
t
u
w
Typedefs
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
Enumerator
a
c
d
e
h
i
l
n
o
p
r
s
t
u
w
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
y
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Typedefs
e
i
l
p
r
s
t
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
e
g
i
o
v
Functions
Macros
e
g
i
o
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
IceUtil
StopWatch.h
Go to the documentation of this file.
1
//
2
// Copyright (c) ZeroC, Inc. All rights reserved.
3
//
4
5
#ifndef ICE_UTIL_STOPWATCH_H
6
#define ICE_UTIL_STOPWATCH_H
7
8
#include <
IceUtil/Time.h
>
9
10
namespace
IceUtilInternal
11
{
12
13
class
StopWatch
14
{
15
public
:
16
17
StopWatch() { }
18
19
void
start()
20
{
21
_s =
IceUtil::Time::now
(
IceUtil::Time::Monotonic
);
22
}
23
24
IceUtil::Int64
stop()
25
{
26
assert(isStarted());
27
IceUtil::Int64
d = (
IceUtil::Time::now
(
IceUtil::Time::Monotonic
) - _s).toMicroSeconds();
28
_s =
IceUtil::Time
();
29
return
d;
30
}
31
32
bool
isStarted()
const
33
{
34
return
_s !=
IceUtil::Time
();
35
}
36
37
IceUtil::Int64
delay()
38
{
39
return
(
IceUtil::Time::now
(
IceUtil::Time::Monotonic
) - _s).toMicroSeconds();
40
}
41
42
private
:
43
44
IceUtil::Time
_s;
45
};
46
47
}
// End namespace IceUtilInternal
48
49
#endif
IceUtil::Time::now
static Time now(Clock=Realtime)
IceUtil::Time::Monotonic
@ Monotonic
Definition:
Time.h:27
IceUtil::Time
Definition:
Time.h:18
Time.h
IceUtil::Int64
long long Int64
Definition:
Config.h:342
Generated by
1.8.20