<p>Backward compatibility for timeval isn't really necessary, since the <code>CLI</code> class is the only one that actually prints the values of the timers.  Really the only need is that we have the functions</p>

<pre><code>Timer::Start("timer_name");
Timer::Stop("timer_name");
Timer::Get("timer_name"); // the return type can change from timeval if needed
</code></pre>

<p>and that every timer that is run during a program is printed by <code>CLI::~CLI()</code>.  I don't see much need to provide any enhancements to the original class because only those three functions are ever used in the mlpack codebase and there's never been any need for more.</p>

<p>I guess maybe a better choice than the timeval class is the std::chrono::duration class?  I'm indifferent to what's used here; the only thing that matters is that the output of <code>CLI::~CLI()</code> remains (just about) the same.  I'd suggest microseconds instead of milliseconds because that's the precision that's currently printed.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/498#issuecomment-188282410">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGhxew4LIMW4Nl4CCL_pDQskFi6Qks5pnbhigaJpZM4G6zFs.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/issues/498#issuecomment-188282410"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>