don't do the work for the performance measurements if the "mail.showMessengerPerformance" pref isn't true. sr=bienvenu

This commit is contained in:
sspitzer%netscape.com 2001-01-12 22:26:10 +00:00
Родитель d9b37ba5b7
Коммит 6840989fca
2 изменённых файлов: 28 добавлений и 20 удалений

Просмотреть файл

@ -183,8 +183,11 @@ function ChangeFolderByURI(uri, isThreaded, sortID, sortDirection, viewType)
ClearThreadPane();
return;
}
gBeforeFolderLoadTime = new Date();
if (showPerformance) {
gBeforeFolderLoadTime = new Date();
}
gCurrentLoadingFolderURI = uri;
gNextMessageAfterDelete = null; // forget what message to select, if any
@ -471,7 +474,7 @@ function FindThreadPaneColumnBySortResource(sortID)
//If it's not true then use the direction passed in.
function SortThreadPane(column, sortKey, secondarySortKey, toggleCurrentDirection, direction, changeCursor)
{
//dump("In SortThreadPane\n");
dump("In SortThreadPane, toggleCurrentDirection = " + toggleCurrentDirection + "\n");
var node = document.getElementById(column);
if(!node)
return false;
@ -503,18 +506,23 @@ function SortThreadPane(column, sortKey, secondarySortKey, toggleCurrentDirectio
SetActiveThreadPaneSortColumn(column);
var selection = SaveThreadPaneSelection();
var beforeSortTime = new Date();
var beforeSortTime;
if(showPerformance) {
beforeSortTime = new Date();
}
if(changeCursor)
SetBusyCursor(window, true);
var result = SortColumn(node, sortKey, secondarySortKey, direction);
if(changeCursor)
SetBusyCursor(window, false);
var afterSortTime = new Date();
var timeToSort = (afterSortTime.getTime() - beforeSortTime.getTime())/1000;
if(showPerformance)
if(showPerformance) {
var afterSortTime = new Date();
var timeToSort = (afterSortTime.getTime() - beforeSortTime.getTime())/1000;
dump("timeToSort is " + timeToSort + "seconds\n");
}
RestoreThreadPaneSelection(selection);
return result;
}

Просмотреть файл

@ -21,7 +21,7 @@
/* This is where functions related to the 3 pane window are kept */
var showPerformance;
var showPerformance = false;
var msgNavigationService;
var gFolderTree;
@ -133,18 +133,20 @@ var folderListener = {
{
gCurrentLoadingFolderURI = "";
//Now let's select the first new message if there is one
var beforeScrollToNew = new Date();
var beforeScrollToNew;
if(showPerformance) {
beforeScrollToNew = new Date();
}
msgNavigationService.EnsureDocumentIsLoaded(document);
ScrollToFirstNewMessage();
var afterScrollToNew = new Date();
var timeToScroll = (afterScrollToNew.getTime() - beforeScrollToNew.getTime())/1000;
if(showPerformance) {
var afterScrollToNew = new Date();
var timeToScroll = (afterScrollToNew.getTime() - beforeScrollToNew.getTime())/1000;
var afterFolderLoadTime = new Date();
var timeToLoad = (afterFolderLoadTime.getTime() - gBeforeFolderLoadTime.getTime())/1000;
if(showPerformance)
{
var afterFolderLoadTime = new Date();
var timeToLoad = (afterFolderLoadTime.getTime() - gBeforeFolderLoadTime.getTime())/1000;
dump("Time to load " + uri + " is " + timeToLoad + " seconds\n");
dump("of which scrolling to new is" + timeToScroll + "seconds\n");
}
@ -300,11 +302,9 @@ function OnLoadMessenger()
//Set focus to the Thread Pane the first time the window is opened.
SetFocusThreadPane();
var afterLoadMessenger = new Date();
var timeToLoad = (afterLoadMessenger.getTime() - beforeLoadMessenger.getTime())/1000;
if(showPerformance)
{
if(showPerformance) {
var afterLoadMessenger = new Date();
var timeToLoad = (afterLoadMessenger.getTime() - beforeLoadMessenger.getTime())/1000;
dump("Time in OnLoadMessger is " + timeToLoad + " seconds\n");
}