<p>In <a href="https://github.com/mlpack/mlpack/pull/567#discussion_r55998368">src/mlpack/core/util/timers.cpp</a>:</p>
<pre style='color:#555'>> @@ -69,15 +61,18 @@ bool Timers::GetState(std::string timerName)
>
> void Timers::PrintTimer(const std::string& timerName)
> {
> - timeval& t = timers[timerName];
> - Log::Info << t.tv_sec << "." << std::setw(6) << std::setfill('0')
> - << t.tv_usec << "s";
> + long long int totalDuration = timers[timerName].count();
> + // Converting microseconds to seconds
> + long long int totalDurationSec = totalDuration / 1e6;
> + long long int totalDurationMicroSec = totalDuration % 1000000;
</pre>
<p>Why not use <code>std::chrono::microseconds::rep</code> here? That would avoid any casting issues.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/567/files#r55998368">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFFbY12rRH3uigRGtOqVnwC0IVhSfks5ptWD4gaJpZM4Hvwm7.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/567/files#r55998368"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>