diff options
author | Chris Wilson <chris+github@qwirx.com> | 2012-11-07 00:02:32 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2012-11-07 00:02:32 +0000 |
commit | dbf45b1a70e2df2055429149420ec2dc82c537d8 (patch) | |
tree | 63cd53af1b075a2d68c5ef625506b7c03eca2e10 | |
parent | 3ba663b5c6e85dbf45b08336bba6333e92555fe1 (diff) |
Log the number of nanoseconds left to sleep, otherwise the log messages
don't make sense.
-rw-r--r-- | lib/common/BoxTime.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/common/BoxTime.cpp b/lib/common/BoxTime.cpp index 298c3910..f62b1c35 100644 --- a/lib/common/BoxTime.cpp +++ b/lib/common/BoxTime.cpp @@ -127,7 +127,7 @@ void ShortSleep(box_time_t duration, bool logDuration) // when nanosleep() returns later than expected. int32_t secs = (int32_t) ts.tv_sec; - int64_t remain_ns = (secs * 1000000000) + ts.tv_nsec; + int64_t remain_ns = ((int64_t)secs * 1000000000) + ts.tv_nsec; if (remain_ns < 0) { @@ -137,9 +137,8 @@ void ShortSleep(box_time_t duration, bool logDuration) return; } - BOX_TRACE("nanosleep interrupted with " << - (remain_ns / 1000000000) << " secs remaining, " - "sleeping again"); + BOX_TRACE("nanosleep interrupted with " << remain_ns << + " nanosecs remaining, sleeping again"); } #endif } |