Answers for "how to use printf with microseconds c++"

C++
0

how to use printf with microseconds c++

printf("%lld", static_cast<long long int> (d));
Posted by: Guest on July-10-2021
0

how to use printf with microseconds c++

{
   printf("%s", std::to_string(d).c_str() );
 }
Posted by: Guest on July-10-2021
0

how to use printf with microseconds c++

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
            )
         );
}
Posted by: Guest on July-10-2021

Browse Popular Code Answers by Language