Lugdunum
0.1.0
src
lug
System
Clock.cpp
Go to the documentation of this file.
1
#include <
lug/System/Clock.hpp
>
2
3
namespace
lug
{
4
namespace
System {
5
6
Clock::Clock
() : _startTime(
Time
::getCurrentTime()) {}
7
8
Clock::Clock
(
const
Clock
& clock)
9
{
10
_startTime
= clock.
_startTime
;
11
}
12
13
Clock::Clock
(
Clock
&& clock)
14
{
15
_startTime
= clock._startTime;
16
}
17
18
Clock
&
Clock::operator=
(
const
Clock
& clock)
19
{
20
_startTime
= clock.
_startTime
;
21
return
*
this
;
22
}
23
24
Clock
&
Clock::operator=
(
Clock
&& clock)
25
{
26
_startTime
= clock._startTime;
27
return
*
this
;
28
}
29
30
Time
Clock::getElapsedTime
()
const
{
31
return
Time
(
Time::getCurrentTime
().getMicroseconds() -
_startTime
.
getMicroseconds
());
32
}
33
34
Time
Clock::reset
() {
35
auto
old =
Time
(
Time::getCurrentTime
().getMicroseconds() -
_startTime
.
getMicroseconds
());
36
37
_startTime
=
Time::getCurrentTime
();
38
return
old;
39
}
40
41
}
// System
42
}
// lug
lug::System::Clock::operator=
Clock & operator=(const Clock &clock)
Definition:
Clock.cpp:18
lug::System::Clock
Definition:
Clock.hpp:9
lug::System::Clock::getElapsedTime
Time getElapsedTime() const
Definition:
Clock.cpp:30
lug::System::Clock::Clock
Clock()
Definition:
Clock.cpp:6
lug::System::Clock::reset
Time reset()
Definition:
Clock.cpp:34
lug::System::Clock::_startTime
Time _startTime
Definition:
Clock.hpp:25
lug::System::Time
Definition:
Time.hpp:9
lug::System::Time::getMicroseconds
int64_t getMicroseconds() const
Definition:
Time.inl:1
lug
Definition:
Application.hpp:11
lug::System::Time::getCurrentTime
static Time getCurrentTime()
Definition:
Time.cpp:11
Clock.hpp
Generated by
1.8.13