History:
MakeHMStime
void MakeHMStime( char *str, clock_t _time )
Converts time in milliseconds to text format hours:minutes:seconds.
Code
void MakeHMStime( char *str, clock_t _time ) { if( _time <= 0 ) _time = 0; float sec,min,ss,Smin,hod; ss = _time/1000; Smin = floor(ss/60); sec = floor(ss-Smin*60); min = floor((ss-floor(Smin/60)*3600)/60); if( Smin >= 60 ) { hod = Smin/60; sprintf(str, "%d:%02d", (int)hod, (int)min); }else{ sprintf(str, "%02d:%02d", (int)min, (int)sec); } }
Code.Tode.cz by Henry - 2014