@@ -10,11 +10,13 @@ namespace BIDSHelper.SSIS
1010 public partial class FindUnusedVariables : Form
1111 {
1212 private BackgroundWorker processPackage = null ;
13- private System . Diagnostics . Stopwatch stopwatch ;
1413 private FindVariables finder = new FindVariables ( ) ;
1514 private Package package ;
1615 private List < string > unusedVariablesList ;
17-
16+ #if DEBUG
17+ private System . Diagnostics . Stopwatch stopwatch ;
18+ #endif
19+
1820 public FindUnusedVariables ( VariablesDisplayMode displayMode )
1921 {
2022 this . DisplayMode = displayMode ;
@@ -84,7 +86,9 @@ public DialogResult Show(Package package)
8486 }
8587 }
8688
89+ #if DEBUG
8790 stopwatch = new System . Diagnostics . Stopwatch ( ) ;
91+ #endif
8892 processPackage . RunWorkerAsync ( variables . ToArray ( ) ) ;
8993
9094 return this . ShowDialog ( ) ;
@@ -116,8 +120,8 @@ private void VariableFound(object sender, VariableFoundEventArgs e)
116120 private void processPackage_RunWorkerCompleted ( object sender , RunWorkerCompletedEventArgs e )
117121 {
118122 this . progressBar . Visible = false ;
119- stopwatch . Stop ( ) ;
120123#if DEBUG
124+ stopwatch . Stop ( ) ;
121125 this . Text = string . Format ( "{0} ({1})" , this . Text , stopwatch . ElapsedMilliseconds ) ;
122126#endif
123127 this . selectionList . ClearItems ( ) ;
@@ -126,8 +130,9 @@ private void processPackage_RunWorkerCompleted(object sender, RunWorkerCompleted
126130
127131 private void processPackage_DoWork ( object sender , DoWorkEventArgs e )
128132 {
133+ #if DEBUG
129134 stopwatch . Start ( ) ;
130-
135+ #endif
131136 Variable [ ] variables = e . Argument as Variable [ ] ;
132137 finder . FindReferences ( this . package , variables , null ) ;
133138 }
0 commit comments