sqldata/str.cpp
// Convert time in milliseconds to string with ms, sec
Convert time in milliseconds to string with ms, sec
Convert time in milliseconds to string with ms sec
char* Str::FormatTime(size_t time_ms, char *output)
{
	if(output == NULL)
		return NULL;
	if(time_ms < 1000)
		sprintf(output, "%d ms", time_ms);
	else
	if(time_ms < 1000 * 60)
		sprintf(output, "%0.1lf sec", ((double)time_ms)/1000);
	else
		sprintf(output, "%d min %d sec", time_ms/60/1000, (time_ms % (60 * 1000))/1000);
	return output;
}
char * Str :: FormatTime ( size_t time_ms , char * output ) { if ( output == NULL ) return NULL ; if ( time_ms < 1000 ) sprintf ( output , " " , time_ms ) ; else if ( time_ms < 1000 * 60 ) sprintf ( output , " " , ( ( double ) time_ms ) / 1000 ) ; else sprintf ( output , " " , time_ms / 60 / 1000 , ( time_ms % ( 60 * 1000 ) ) / 1000 ) ; return output ; }
Convert time in milliseconds to string with ms, sec
Convert time in milliseconds to string with ms sec