Use NSPR logging rather than printf's for stopwatch output.

git-svn-id: svn://10.0.0.236/trunk@48975 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nisheeth%netscape.com
1999-09-24 08:57:36 +00:00
parent bf42b552d5
commit 351d8f1643
8 changed files with 26 additions and 26 deletions

View File

@@ -1718,9 +1718,9 @@ HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel)
// NRA Dump stopwatch stop info here
#ifdef RAPTOR_PERF_METRICS
NS_STOP_STOPWATCH(mWatch)
printf("Content creation time: ");
RAPTOR_STOPWATCH_TRACE(("Content creation time: "));
mWatch.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
if (nsnull == mTitle) {

View File

@@ -2095,7 +2095,7 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
nsresult rv = NS_OK;
rv = aUri->GetSpec(&url);
if (NS_SUCCEEDED(rv)) {
printf("*** Timing layout processes on url: '%s'\n", url);
RAPTOR_STOPWATCH_TRACE(("*** Timing layout processes on url: '%s'\n", url));
delete [] url;
}
}
@@ -3356,9 +3356,9 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
{
#ifdef RAPTOR_PERF_METRICS
NS_STOP_STOPWATCH(mTotalTime)
printf("Total Layout+Load Time: ");
RAPTOR_STOPWATCH_TRACE(("Total (Layout + Page Load) Time: "));
mTotalTime.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
nsresult rv = NS_ERROR_FAILURE;

View File

@@ -940,9 +940,9 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD, PRBool aIsFinalChunk) {
// mTotalTime.Print();
// printf("\n");
printf("Parse Time: ");
RAPTOR_STOPWATCH_TRACE(("Parse Time: "));
mParseTime.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
return mInternalState;

View File

@@ -1185,22 +1185,22 @@ PresShell::EndLoad(nsIDocument *aDocument)
#ifdef RAPTOR_PERF_METRICS
// Dump reflow, style resolution and frame construction times here.
NS_STOP_STOPWATCH(mReflowWatch)
printf("Reflow time: ");
RAPTOR_STOPWATCH_TRACE(("Reflow time: "));
mReflowWatch.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
NS_STOP_STOPWATCH(mFrameCreationWatch)
printf("Frame construction plus style resolution time: ");
RAPTOR_STOPWATCH_TRACE(("Frame construction plus style resolution time: "));
mFrameCreationWatch.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
// Print style resolution stopwatch maintained by style set
nsresult rv = NS_OK;
nsCOMPtr<nsITimeRecorder> watch = do_QueryInterface(mStyleSet, &rv);
if (NS_SUCCEEDED(rv) && watch) {
watch->StopTimer(NS_TIMER_STYLE_RESOLUTION);
printf("Style resolution time: ");
RAPTOR_STOPWATCH_TRACE(("Style resolution time: "));
watch->PrintTimer(NS_TIMER_STYLE_RESOLUTION);
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
}
#endif
return NS_OK;

View File

@@ -1185,22 +1185,22 @@ PresShell::EndLoad(nsIDocument *aDocument)
#ifdef RAPTOR_PERF_METRICS
// Dump reflow, style resolution and frame construction times here.
NS_STOP_STOPWATCH(mReflowWatch)
printf("Reflow time: ");
RAPTOR_STOPWATCH_TRACE(("Reflow time: "));
mReflowWatch.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
NS_STOP_STOPWATCH(mFrameCreationWatch)
printf("Frame construction plus style resolution time: ");
RAPTOR_STOPWATCH_TRACE(("Frame construction plus style resolution time: "));
mFrameCreationWatch.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
// Print style resolution stopwatch maintained by style set
nsresult rv = NS_OK;
nsCOMPtr<nsITimeRecorder> watch = do_QueryInterface(mStyleSet, &rv);
if (NS_SUCCEEDED(rv) && watch) {
watch->StopTimer(NS_TIMER_STYLE_RESOLUTION);
printf("Style resolution time: ");
RAPTOR_STOPWATCH_TRACE(("Style resolution time: "));
watch->PrintTimer(NS_TIMER_STYLE_RESOLUTION);
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
}
#endif
return NS_OK;

View File

@@ -1718,9 +1718,9 @@ HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel)
// NRA Dump stopwatch stop info here
#ifdef RAPTOR_PERF_METRICS
NS_STOP_STOPWATCH(mWatch)
printf("Content creation time: ");
RAPTOR_STOPWATCH_TRACE(("Content creation time: "));
mWatch.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
if (nsnull == mTitle) {

View File

@@ -940,9 +940,9 @@ nsresult nsParser::ResumeParse(nsIDTD* aDefaultDTD, PRBool aIsFinalChunk) {
// mTotalTime.Print();
// printf("\n");
printf("Parse Time: ");
RAPTOR_STOPWATCH_TRACE(("Parse Time: "));
mParseTime.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
return mInternalState;

View File

@@ -2095,7 +2095,7 @@ nsWebShell::DoLoadURL(nsIURI * aUri,
nsresult rv = NS_OK;
rv = aUri->GetSpec(&url);
if (NS_SUCCEEDED(rv)) {
printf("*** Timing layout processes on url: '%s'\n", url);
RAPTOR_STOPWATCH_TRACE(("*** Timing layout processes on url: '%s'\n", url));
delete [] url;
}
}
@@ -3356,9 +3356,9 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
{
#ifdef RAPTOR_PERF_METRICS
NS_STOP_STOPWATCH(mTotalTime)
printf("Total Layout+Load Time: ");
RAPTOR_STOPWATCH_TRACE(("Total (Layout + Page Load) Time: "));
mTotalTime.Print();
printf("\n");
RAPTOR_STOPWATCH_TRACE(("\n"));
#endif
nsresult rv = NS_ERROR_FAILURE;