mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add many more stopwatches
This commit is contained in:
@@ -104,6 +104,8 @@ namespace SabreTools.Filtering
|
||||
/// <returns>True if cleaning was successful, false on error</returns>
|
||||
public bool ApplyCleaning(DatFile datFile, bool throwOnError = false)
|
||||
{
|
||||
InternalStopwatch watch = new InternalStopwatch("Applying cleaning steps to DAT");
|
||||
|
||||
try
|
||||
{
|
||||
// Perform item-level cleaning
|
||||
@@ -143,6 +145,10 @@ namespace SabreTools.Filtering
|
||||
logger.Error(ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace SabreTools.Filtering
|
||||
/// <param name="inputs">Field and file combinations</param>
|
||||
public void PopulateFromList(List<string> inputs)
|
||||
{
|
||||
InternalStopwatch watch = new InternalStopwatch("Populating extras from list");
|
||||
|
||||
foreach (string input in inputs)
|
||||
{
|
||||
ExtraIniItem item = new ExtraIniItem();
|
||||
@@ -70,6 +72,8 @@ namespace SabreTools.Filtering
|
||||
if (item.PopulateFromFile(fileString))
|
||||
Items.Add(item);
|
||||
}
|
||||
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -84,6 +88,8 @@ namespace SabreTools.Filtering
|
||||
/// <returns>True if the extras were applied, false on error</returns>
|
||||
public bool ApplyExtras(DatFile datFile, bool throwOnError = false)
|
||||
{
|
||||
InternalStopwatch watch = new InternalStopwatch("Applying extra mappings to DAT");
|
||||
|
||||
try
|
||||
{
|
||||
// Bucket by game first
|
||||
@@ -130,6 +136,10 @@ namespace SabreTools.Filtering
|
||||
logger.Error(ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ namespace SabreTools.Filtering
|
||||
/// <param name="fields">List of field names</param>
|
||||
public void PopulateExclusionsFromList(List<string> fields)
|
||||
{
|
||||
InternalStopwatch watch = new InternalStopwatch("Populating removals from list");
|
||||
|
||||
// Instantiate the removers, if necessary
|
||||
DatHeaderRemover ??= new DatHeaderRemover();
|
||||
DatItemRemover ??= new DatItemRemover();
|
||||
@@ -81,6 +83,8 @@ namespace SabreTools.Filtering
|
||||
// If we didn't match anything, log an error
|
||||
logger.Warning($"The value {field} did not match any known field names. Please check the wiki for more details on supported field names.");
|
||||
}
|
||||
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -98,7 +102,7 @@ namespace SabreTools.Filtering
|
||||
return;
|
||||
|
||||
// Output the logging statement
|
||||
logger.User("Removing filtered fields");
|
||||
InternalStopwatch watch = new InternalStopwatch("Applying removals to DAT");
|
||||
|
||||
// Remove DatHeader fields
|
||||
if (DatHeaderRemover != null)
|
||||
@@ -119,6 +123,8 @@ namespace SabreTools.Filtering
|
||||
datFile.Items.AddRange(key, items);
|
||||
});
|
||||
}
|
||||
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -47,6 +47,8 @@ namespace SabreTools.Filtering
|
||||
/// <returns>True if the DatFile was split, false on error</returns>
|
||||
public bool ApplySplitting(DatFile datFile, bool useTags, bool throwOnError = false)
|
||||
{
|
||||
InternalStopwatch watch = new InternalStopwatch("Applying splitting to DAT");
|
||||
|
||||
try
|
||||
{
|
||||
// If we are using tags from the DAT, set the proper input for split type unless overridden
|
||||
@@ -81,6 +83,10 @@ namespace SabreTools.Filtering
|
||||
logger.Error(ex);
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
watch.Stop();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user