diff options
Diffstat (limited to 'src/utils/performance.cpp')
-rw-r--r-- | src/utils/performance.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/utils/performance.cpp b/src/utils/performance.cpp index ccc232aa4..e18e848e4 100644 --- a/src/utils/performance.cpp +++ b/src/utils/performance.cpp @@ -28,6 +28,7 @@ #include "configuration.h" #include "game.h" +#include "utils/cast.h" #include "utils/timer.h" #include <algorithm> @@ -41,8 +42,8 @@ static const clockid_t clockType = CLOCK_MONOTONIC; -#define timeData ((static_cast<long long int>(time.tv_sec) * 1000000000LL \ - + static_cast<long long int>(time.tv_nsec)) / 1) +#define timeData \ + (CAST_U64(time.tv_sec) * 1000000000LL + CAST_U64(time.tv_nsec)) namespace Performance { @@ -69,24 +70,26 @@ namespace Performance { timespec time; clock_gettime(clockType, &time); - temp.append(toString(timeData - startTime)).append( - " __init__\n"); + temp.append(toString(CAST_U64(timeData - startTime))) + .append(" __init__\n"); } void blockStart(const std::string &name) { timespec time; clock_gettime(clockType, &time); - temp.append(toString(timeData - startTime)).append( - " start: ").append(name).append("\n"); + temp.append(toString(CAST_U64(timeData - startTime))) + .append(" start: ") + .append(name).append("\n"); } void blockEnd(const std::string &name) { timespec time; clock_gettime(clockType, &time); - temp.append(toString(timeData - startTime)).append( - " end: ").append(name).append("\n"); + temp.append(toString(CAST_U64(timeData - startTime))) + .append(" end: ") + .append(name).append("\n"); } void flush() |