したがって、私は Unix を初めて使用し、その API を知りません。Unix のミラー API とは何ですか?
#include <boost/date_time.hpp>
class timer
{
public:
timer();
void restart();
boost::posix_time::time_duration elapsed() const;
private:
boost::posix_time::ptime start_time;
};
// and cpp looks like
#include "timer.h"
timer::timer() : start_time(boost::posix_time::microsec_clock::local_time()) { }
void timer::restart()
{
start_time = boost::posix_time::microsec_clock::local_time();
}
boost::posix_time::time_duration timer::elapsed() const
{
return boost::posix_time::microsec_clock::local_time() - start_time;
}
では、Unix API を使用して単純なクラスでブーストの使用を削除するにはどうすればよいでしょうか?