Add ability to show the time taken by update.php
authormayankmadan <maddiemadan@gmail.com>
Sun, 3 Nov 2013 14:47:02 +0000 (20:17 +0530)
committermayankmadan <maddiemadan@gmail.com>
Tue, 5 Nov 2013 04:17:39 +0000 (09:47 +0530)
Bug: 28278

Change-Id: I42cd0da35a2ed20748374afbe1a02773cd941136

maintenance/update.php

index 378217f..5c93964 100644 (file)
@@ -132,6 +132,8 @@ class UpdateMediaWiki extends Maintenance {
                        wfCountDown( 5 );
                }
 
+               $time1 = new MWTimestamp();
+
                $shared = $this->hasOption( 'doshared' );
 
                $updates = array( 'core', 'extensions' );
@@ -164,8 +166,10 @@ class UpdateMediaWiki extends Maintenance {
                if ( !$this->hasOption( 'nopurge' ) ) {
                        $updater->purgeCache();
                }
+               $time2 = new MWTimestamp();
 
                $this->output( "\nDone.\n" );
+               $this->output( "\nThe job took ". $time2->diff( $time1 )->format( "%i:%S" ). "\n" );
        }
 
        function afterFinalSetup() {