Perhaps this is not directly related to the 32/64 bit problem, but some of us work on embedded systems with odd output consoles and C ++ libraries. (In addition, we know that if we need to do some serious formatting of the output, printf is more intelligent than iomanip!)
In any case, it prints guts of duration and may be useful for debugging:
template<typename Rep, typename Ratio>
printf_dur( std::chrono::duration< Rep, Ratio > dur )
{
printf( "%lld ticks of %lld/%lld == %.3fs",
(long long int) dur.count(),
(long long int) Ratio::num,
(long long int) Ratio::den,
( (Ratio::num == 1LL)
? (float) dur.count() / (float) Ratio::den
: (float) dur.count() * (float) Ratio::num
)
);
}
source
share