diff options
author | albert-github <albert.tests@gmail.com> | 2020-07-06 13:20:19 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-07-06 13:20:19 (GMT) |
commit | 044fde94fc0ff1dfba618a72dbee286afa755405 (patch) | |
tree | b64b763b49baa004fc15859dd359d3615e79b4c6 /src/debug.cpp | |
parent | 8c12604a84faabf6beeef7f159692ccddcb94dc6 (diff) | |
download | Doxygen-044fde94fc0ff1dfba618a72dbee286afa755405.zip Doxygen-044fde94fc0ff1dfba618a72dbee286afa755405.tar.gz Doxygen-044fde94fc0ff1dfba618a72dbee286afa755405.tar.bz2 |
Compilation warning in debug.cpp
When compiling debug.cpp on a 32-bit Windows system we get the warning:
```
...\doxygen\src\debug.cpp(121): warning C4244: 'return': conversion from '_Rep' to 'int', possible loss of data
with
[
_Rep=__int64
]
```
as we only use the seconds representation of the elapsed time we can do the conversion to seconds in the Timer class.
Diffstat (limited to 'src/debug.cpp')
-rw-r--r-- | src/debug.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/debug.cpp b/src/debug.cpp index ca3c1e9..6815b3b 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -114,11 +114,11 @@ class Timer { m_startTime = std::chrono::system_clock::now(); } - int elapsedTimeMs() + double elapsedTimeS() { - return std::chrono::duration_cast< + return (std::chrono::duration_cast< std::chrono::milliseconds>( - std::chrono::system_clock::now() - m_startTime).count(); + std::chrono::system_clock::now() - m_startTime).count()) / 1000.0; } private: std::chrono::time_point<std::chrono::system_clock> m_startTime; @@ -131,8 +131,8 @@ void Debug::startTimer() g_runningTime.start(); } -int Debug::elapsedTime() +double Debug::elapsedTime() { - return g_runningTime.elapsedTimeMs(); + return g_runningTime.elapsedTimeS(); } |