Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITABase
Commits
95d5270d
Commit
95d5270d
authored
Aug 26, 2016
by
Jonas Stienen
Browse files
Linux compatible stopwatch fixes (to_string abandoned)
parent
ae917c9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ITAStopWatch.cpp
View file @
95d5270d
...
...
@@ -163,14 +163,17 @@ double ITAStopWatch::selftest()
std
::
string
TimeToString
(
double
dTimeSeconds
)
{
if
(
dTimeSeconds
<
1e-6
)
return
std
::
string
(
std
::
to_string
(
long
double
(
dTimeSeconds
/
1e-9
)
)
+
"us"
);
std
::
stringstream
ss
;
if
(
dTimeSeconds
<
1e-6
)
ss
<<
dTimeSeconds
/
1e-9
<<
"us"
;
else
if
(
dTimeSeconds
<
1e-3
)
return
std
::
string
(
std
::
to_string
(
long
double
(
dTimeSeconds
/
1e-6
))
+
"ns"
)
;
ss
<<
dTimeSeconds
/
1e-6
<<
"ns"
;
else
if
(
dTimeSeconds
<
1e-0
)
return
std
::
string
(
std
::
to_string
(
long
double
(
dTimeSeconds
/
1e-3
))
+
"ms"
)
;
ss
<<
dTimeSeconds
/
1e-3
<<
"ms"
;
else
return
std
::
string
(
std
::
to_string
(
long
double
(
dTimeSeconds
))
+
"s"
);
ss
<<
dTimeSeconds
<<
"s"
;
return
ss
.
str
();
};
std
::
string
ITAStopWatch
::
ToString
()
const
...
...
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