[mlpack-git] [mlpack] Changes to solve issue #498: Replacing timer implementation (#567)

Naman Taneja notifications at github.com
Mon Mar 14 14:41:37 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;

Converted all the values to std::chrono::duration, to avoid casting issues.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/567/files#r56053378
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160314/cbcc6068/attachment.html>


More information about the mlpack-git mailing list