mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Display update utility elapsed time.
This commit is contained in:
parent
edae590b2c
commit
642fd1e8da
@ -71,9 +71,11 @@ int main( int argc, char** argv )
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
int64_t t;
|
||||||
float ratio;
|
float ratio;
|
||||||
int inVer;
|
int inVer;
|
||||||
{
|
{
|
||||||
|
const auto t0 = std::chrono::high_resolution_clock::now();
|
||||||
tracy::Worker worker( *f, tracy::EventType::All, false );
|
tracy::Worker worker( *f, tracy::EventType::All, false );
|
||||||
|
|
||||||
#ifndef TRACY_NO_STATISTICS
|
#ifndef TRACY_NO_STATISTICS
|
||||||
@ -90,9 +92,11 @@ int main( int argc, char** argv )
|
|||||||
fflush( stdout );
|
fflush( stdout );
|
||||||
worker.Write( *w );
|
worker.Write( *w );
|
||||||
w->Finish();
|
w->Finish();
|
||||||
|
const auto t1 = std::chrono::high_resolution_clock::now();
|
||||||
const auto stats = w->GetCompressionStatistics();
|
const auto stats = w->GetCompressionStatistics();
|
||||||
ratio = 100.f * stats.second / stats.first;
|
ratio = 100.f * stats.second / stats.first;
|
||||||
inVer = worker.GetTraceVersion();
|
inVer = worker.GetTraceVersion();
|
||||||
|
t = std::chrono::duration_cast<std::chrono::nanoseconds>( t1 - t0 ).count();
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE* in = fopen( input, "rb" );
|
FILE* in = fopen( input, "rb" );
|
||||||
@ -105,10 +109,10 @@ int main( int argc, char** argv )
|
|||||||
const auto outSize = ftello64( out );
|
const auto outSize = ftello64( out );
|
||||||
fclose( out );
|
fclose( out );
|
||||||
|
|
||||||
printf( "%s (%i.%i.%i) {%s} -> %s (%i.%i.%i) {%s, %.2f%%} %.2f%% size change\n",
|
printf( "%s (%i.%i.%i) {%s} -> %s (%i.%i.%i) {%s, %.2f%%} %s, %.2f%% change\n",
|
||||||
input, inVer >> 16, ( inVer >> 8 ) & 0xFF, inVer & 0xFF, tracy::MemSizeToString( inSize ),
|
input, inVer >> 16, ( inVer >> 8 ) & 0xFF, inVer & 0xFF, tracy::MemSizeToString( inSize ),
|
||||||
output, tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, tracy::MemSizeToString( outSize ), ratio,
|
output, tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, tracy::MemSizeToString( outSize ), ratio,
|
||||||
float( outSize ) / inSize * 100 );
|
tracy::TimeToString( t ), float( outSize ) / inSize * 100 );
|
||||||
}
|
}
|
||||||
catch( const tracy::UnsupportedVersion& e )
|
catch( const tracy::UnsupportedVersion& e )
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user