#include <cstdio>
#include "boost/date_time/posix_time/posix_time.hpp"
int main(int argc, char** argv) {
boost::posix_time::ptime start =
boost::posix_time::microsec_clock::local_time();
uint32_t iterations = 0;
// Do a bunch of work. `iterations` becomes > 0
boost::posix_time::ptime now =
boost::posix_time::microsec_clock::local_time();
boost::posix_time::time_duration diff = now - start;
printf("Milliseconds per iteration: %f\n",
static_cast<float>(diff.total_milliseconds()) / iterations);
return 0;
}
これにより、負の値が出力されました。どうすればいいの?