Add build time routines. NOT PART OF THE BUILD

This commit is contained in:
sfraser%netscape.com 2000-10-26 06:00:31 +00:00
parent caf1cd5c78
commit b2a2d07e66
2 changed files with 42 additions and 1 deletions

View File

@ -311,11 +311,17 @@ sub RunBuild($$$$)
DoPrebuildCheck();
if ($do_pull) {
my($start_time) = TimeStart();
Checkout($input_files->{"checkoutdata"});
TimeEnd($start_time, "Checkout");
}
unless ($do_build) { return; }
my($build_start) = TimeStart();
# create generated headers
ConfigureBuildSystem();
UpdateBuildNumberFiles();
@ -327,7 +333,9 @@ sub RunBuild($$$$)
BuildProjects();
# the build finished, so clear the build progress state
ClearBuildProgress();
ClearBuildProgress();
TimeEnd($build_start, "Build");
print "Build complete\n";
}

View File

@ -31,6 +31,8 @@ use vars qw(@ISA @EXPORT);
BuildFolderResourceAliases
AskAndPersistFile
DelayFor
TimeStart
TimeEnd
EmptyTree
SetupBuildLog
SetBuildNumber
@ -239,6 +241,37 @@ sub DelayFor($)
}
#//--------------------------------------------------------------------------------------------------
#// TimeStart
#//--------------------------------------------------------------------------------------------------
sub TimeStart()
{
return time();
}
#//--------------------------------------------------------------------------------------------------
#// TimeEnd
#//--------------------------------------------------------------------------------------------------
sub TimeEnd($$)
{
use integer;
my($start_time, $operation_name) = @_;
my($end_time) = time();
my($tot_sec) = $end_time - $start_time;
my($seconds) = $tot_sec;
my($hours) = $seconds / (60 * 60);
$seconds -= $hours * (60 * 60);
my($minutes) = $seconds / 60;
$seconds -= $minutes * 60;
print "$operation_name took $hours hours $minutes minutes and $seconds seconds\n";
}
#//--------------------------------------------------------------------------------------------------
#// Remove all files from a tree, leaving directories intact (except "CVS").
#//--------------------------------------------------------------------------------------------------