std::clock(), threading, and Linux
I had a strange experience with the boost::timer class the other day, since it never elapsed within a certain thread. As it turns out, this was because std::clock() itself doesn’t tick but returns the same value over and over again - a value that probably indicates the time the tread was started. The solution is rather simple: I implemented the boost::timer interface based upon boost::xtime from the boost threading library like this: