[mlpack-git] [mlpack] Replace timers.cpp implementation with std::chrono (#498)

Ryan Curtin notifications at github.com
Wed Feb 24 09:40:34 EST 2016


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

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

and that every timer that is run during a program is printed by `CLI::~CLI()`.  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.

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

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/498#issuecomment-188282410
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160224/7c6dcfee/attachment.html>


More information about the mlpack-git mailing list