Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
2c2ac653
Commit
2c2ac653
authored
Jan 19, 2017
by
LEFEBVREJP email
Browse files
Updating timer to use steady_clock instead of system_clock to avoid system clock change.
parent
ea0d60b5
Pipeline
#7417
passed with stages
in 27 minutes and 26 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
radixbug/bug.hh
View file @
2c2ac653
...
...
@@ -124,8 +124,8 @@ class Timer
{
private:
bool
mRunning
;
std
::
chrono
::
s
ystem
_clock
::
time_point
mStart
;
std
::
chrono
::
s
ystem
_clock
::
time_point
mEnd
;
std
::
chrono
::
s
teady
_clock
::
time_point
mStart
;
std
::
chrono
::
s
teady
_clock
::
time_point
mEnd
;
std
::
chrono
::
nanoseconds
mDuration
;
size_t
mIntervals
;
public:
...
...
@@ -139,12 +139,12 @@ public:
radix_check
(
!
mRunning
);
mRunning
=
true
;
mIntervals
++
;
mStart
=
std
::
chrono
::
s
ystem
_clock
::
now
();
mStart
=
std
::
chrono
::
s
teady
_clock
::
now
();
}
void
stop
()
{
radix_check
(
mRunning
);
mEnd
=
std
::
chrono
::
s
ystem
_clock
::
now
();
mEnd
=
std
::
chrono
::
s
teady
_clock
::
now
();
mRunning
=
false
;
mDuration
+=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
nanoseconds
>
(
mEnd
-
mStart
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment