$this->logPerformance = false;
}
}
- $baseTime = $startTime = $this->getMicroTime();
+ $baseTime = $startTime = microtime( true );
# Create a title -> cur_id map
$this->output( "Loading IDs from $cur table...\n" );
$this->performanceLog( $fh, "Reading $numRows rows from cur table...\n" );
if ( ( $curRowsRead % $curReadReportInterval ) == 0 ) {
$this->performanceLog(
$fh,
- $curRowsRead . " " . ( $this->getMicroTime() - $baseTime ) . "\n"
+ $curRowsRead . " " . ( microtime( true ) - $baseTime ) . "\n"
);
$this->output( "\t$curRowsRead rows of $cur table read.\n" );
}
$this->output( "Finished loading IDs.\n\n" );
$this->performanceLog(
$fh,
- "Took " . ( $this->getMicroTime() - $baseTime ) . " seconds to load IDs.\n\n"
+ "Took " . ( microtime( true ) - $baseTime ) . " seconds to load IDs.\n\n"
);
# --------------------------------------------------------------------
# convert, and write to the new table.
$this->createTempTable();
$this->performanceLog( $fh, "Resetting timer.\n\n" );
- $baseTime = $this->getMicroTime();
+ $baseTime = microtime( true );
$this->output( "Processing $numRows rows from $links table...\n" );
$this->performanceLog( $fh, "Processing $numRows rows from $links table...\n" );
$this->performanceLog( $fh, "rows inserted vs seconds elapsed:\n" );
$this->output( " done. Total $totalTuplesInserted tuples inserted.\n" );
$this->performanceLog(
$fh,
- $totalTuplesInserted . " " . ( $this->getMicroTime() - $baseTime ) . "\n"
+ $totalTuplesInserted . " " . ( microtime( true ) - $baseTime ) . "\n"
);
}
}
);
$this->performanceLog(
$fh,
- "Total execution time: " . ( $this->getMicroTime() - $startTime ) . " seconds.\n"
+ "Total execution time: " . ( microtime( true ) - $startTime ) . " seconds.\n"
);
if ( $this->logPerformance ) {
fclose( $fh );
fwrite( $fh, $text );
}
}
-
- private function getMicroTime() { # return time in seconds, with microsecond accuracy
- list( $usec, $sec ) = explode( " ", microtime() );
-
- return ( (float)$usec + (float)$sec );
- }
}
$maintClass = "ConvertLinks";