Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2020-02-08 15:35:36 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2020-02-08 15:35:36 +0300
commit642fd1e8da754e85dcf781403a730b154a4f630c (patch)
treea06c28e8788615c9667f869d2f0f57b95fbecf0a /update/src
parentedae590b2cb845139389e882bf360e5d6f087b5e (diff)
Display update utility elapsed time.
Diffstat (limited to 'update/src')
-rw-r--r--update/src/update.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/update/src/update.cpp b/update/src/update.cpp
index c30d95da..ea49f31e 100644
--- a/update/src/update.cpp
+++ b/update/src/update.cpp
@@ -71,9 +71,11 @@ int main( int argc, char** argv )
try
{
+ int64_t t;
float ratio;
int inVer;
{
+ const auto t0 = std::chrono::high_resolution_clock::now();
tracy::Worker worker( *f, tracy::EventType::All, false );
#ifndef TRACY_NO_STATISTICS
@@ -90,9 +92,11 @@ int main( int argc, char** argv )
fflush( stdout );
worker.Write( *w );
w->Finish();
+ const auto t1 = std::chrono::high_resolution_clock::now();
const auto stats = w->GetCompressionStatistics();
ratio = 100.f * stats.second / stats.first;
inVer = worker.GetTraceVersion();
+ t = std::chrono::duration_cast<std::chrono::nanoseconds>( t1 - t0 ).count();
}
FILE* in = fopen( input, "rb" );
@@ -105,10 +109,10 @@ int main( int argc, char** argv )
const auto outSize = ftello64( 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 ),
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 )
{