[mlpack-git] [mlpack] Changes to solve issue #498: Replacing timer implementation (#567)
Ryan Curtin
notifications at github.com
Mon Mar 14 09:22:00 EDT 2016
> @@ -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;
Why not use `std::chrono::microseconds::rep` here? That would avoid any casting issues.
---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/567/files#r55998368
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160314/c9056c57/attachment.html>
More information about the mlpack-git
mailing list