Merge pull request #2 from Tatsh/print-finished

main: print start and finish times
pull/328/head
Sam Andersen 2020-12-20 22:19:53 -08:00 committed by GitHub
commit a63c2289a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -241,7 +241,9 @@ int Main( int argc, char **argv )
if ( vm.count( "download-speed" ) > 0 )
agent.SetDownloadSpeed( vm["download-speed"].as<unsigned>() * 1000 );
Drive drive( &syncer, config.GetAll() ) ;
DateTime startTime = DateTime::Now();
Log( "\nStarted at %1%", startTime, log::info );
Drive drive( &syncer, config.GetAll() );
drive.DetectChanges() ;
if ( vm.count( "dry-run" ) == 0 )
@ -259,7 +261,12 @@ int Main( int argc, char **argv )
drive.DryRun() ;
config.Save() ;
Log( "Finished!", log::info ) ;
DateTime endTime = DateTime::Now();
Log(
"Finished at %1% (%2% seconds)",
endTime,
endTime.Sec() - startTime.Sec(),
log::info );
return 0 ;
}