
I started working on the timers after noticing some flaws in the current boost::timer, particularly the fact that it doesn't take into account that std::clock() can fail. In the first draft of my code no boost::date_time facility was used, partly because I wanted to come up with an autonomous solution and partly because I'm a billy goat with the date-time library in general (I wanted my code to be interoperable with date-time, but not depending on it; just like you can often make a template mpl-compatible by just providing a nested "type" typedef).
What I don't understand is why you didn't talk earlier in this thread ? You seem to have missed a lot of discussion where your input would have been interesting. * it separates the "elapsed timer" notion from the notion of "clock
device" (the "source"); the advantage is that you can plug-in any source you want.The only requirement on the source class is that it provides:
- a time_duration_type typedef - void start(); - time_duration_type elapsed()
It's basically the same design than Jeff proposed (about it being templated on the clock) except it's not tied to the boost::date_time interface which makes it suitable for timers like QueryPerformanceCounter, that's why I think I'll refactor it a bit to follow your design so we can have one generic template class instead of template specializations. That should cover the basics and make the code comments more
understandable. In short, we are still at the drawing board, but once the design is in place, it really takes a little time to write down the code.
Right so you are actually proposing whole new round of discussions... ok, I thought we had this behind :) I'm not used to the boost mailing list enough I guess. Philippe