How to printf a time_t variable as a floating point number?

Posted by soneangel on Stack Overflow See other posts from Stack Overflow or by soneangel
Published on 2010-04-13T15:50:23Z Indexed on 2010/04/13 15:53 UTC
Read the original article Hit count: 251

Filed under:
|
|
|
|

Hi guys, I'm using a time_t variable in C (openMP enviroment) to keep cpu execution time...I define a float value sum_tot_time to sum time for all cpu's...I mean sum_tot_time is the sum of cpu's time_t values. The problem is that printing the value sum_tot_time it appear as an integer or long, by the way without its decimal part! I tried in these ways: to printf sum_tot_time as a double being a double value to printf sum_tot_time as float being a float value to printf sum_tot_time as double being a time_t value to printf sum_tot_time as float being a time_t value

Please help me!!

© Stack Overflow or respective owner

Related posts about c

    Related posts about time-t