extend log timestamps to three decimal places
This commit is contained in:
@@ -242,7 +242,7 @@ void RageLog::Write( int where, const CString &line )
|
|||||||
|
|
||||||
CString LineHeader;
|
CString LineHeader;
|
||||||
if( m_bTimestamping )
|
if( m_bTimestamping )
|
||||||
LineHeader += SecondsToMMSSMsMs(RageTimer::GetTimeSinceStart()) + ": ";
|
LineHeader += SecondsToMMSSMsMsMs(RageTimer::GetTimeSinceStart()) + ": ";
|
||||||
if( where & WRITE_LOUD )
|
if( where & WRITE_LOUD )
|
||||||
LineHeader += "WARNING: ";
|
LineHeader += "WARNING: ";
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ void RageLog::MapLog(const CString &key, const char *fmt, ...)
|
|||||||
{
|
{
|
||||||
CString s;
|
CString s;
|
||||||
if( m_bTimestamping )
|
if( m_bTimestamping )
|
||||||
s += SecondsToMMSSMsMs(RageTimer::GetTimeSinceStart()) + ": ";
|
s += SecondsToMMSSMsMsMs(RageTimer::GetTimeSinceStart()) + ": ";
|
||||||
|
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
|
|||||||
@@ -126,6 +126,15 @@ CString SecondsToMMSSMsMs( float fSecs )
|
|||||||
return sReturn;
|
return sReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CString SecondsToMMSSMsMsMs( float fSecs )
|
||||||
|
{
|
||||||
|
const int iMinsDisplay = (int)fSecs/60;
|
||||||
|
const int iSecsDisplay = (int)fSecs - iMinsDisplay*60;
|
||||||
|
const float fLeftoverDisplay = (fSecs - iMinsDisplay*60 - iSecsDisplay) * 1000;
|
||||||
|
CString sReturn = ssprintf( "%02d:%02d.%03.0f", iMinsDisplay, iSecsDisplay, min(999.0f,fLeftoverDisplay) );
|
||||||
|
return sReturn;
|
||||||
|
}
|
||||||
|
|
||||||
CString PrettyPercent( float fNumerator, float fDenominator)
|
CString PrettyPercent( float fNumerator, float fDenominator)
|
||||||
{
|
{
|
||||||
return ssprintf("%0.2f%%",fNumerator/fDenominator*100);
|
return ssprintf("%0.2f%%",fNumerator/fDenominator*100);
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ bool IsHexVal( const CString &s );
|
|||||||
float HHMMSSToSeconds( const CString &sHMS );
|
float HHMMSSToSeconds( const CString &sHMS );
|
||||||
CString SecondsToHHMMSS( float fSecs );
|
CString SecondsToHHMMSS( float fSecs );
|
||||||
CString SecondsToMMSSMsMs( float fSecs );
|
CString SecondsToMMSSMsMs( float fSecs );
|
||||||
|
CString SecondsToMMSSMsMsMs( float fSecs );
|
||||||
CString PrettyPercent( float fNumerator, float fDenominator );
|
CString PrettyPercent( float fNumerator, float fDenominator );
|
||||||
inline CString PrettyPercent( int fNumerator, int fDenominator ) { return PrettyPercent( float(fNumerator), float(fDenominator) ); }
|
inline CString PrettyPercent( int fNumerator, int fDenominator ) { return PrettyPercent( float(fNumerator), float(fDenominator) ); }
|
||||||
CString Commify( int iNum );
|
CString Commify( int iNum );
|
||||||
|
|||||||
Reference in New Issue
Block a user