Reputation: 523
One can get the total number of microseconds from a time_duration via the total_microseconds method, but I can't figure out how to re-construct a time_duration from that number. There seems to be no constructors for such a purpose in the documentation, am I missing something?
Upvotes: 2
Views: 5039
Reputation: 47498
There are boost::posix_time::microseconds:
#include <iostream>
#include <boost/date_time.hpp>
namespace bpt = boost::posix_time;
int main()
{
bpt::time_duration td = bpt::microseconds(12345678);
std::cout << td << '\n';
}
Upvotes: 5