11
2- using System ;
3-
42namespace sql_profiler
53{
64
@@ -278,16 +276,34 @@ public static string GetPlatformDefaultInstance()
278276
279277 return System . Environment . MachineName ;
280278 } // End Function GetPlatformDefaultInstance
281-
282-
279+
280+
283281 static void Main ( string [ ] args )
284282 {
285- System . Console . Title = "This is Sparta !" ;
286-
283+ System . Console . Title = "https://github.com/ststeiger/sql_profiler" ;
284+
285+ ᅠ300 = new System . Timers . Timer ( 4000 ) ;
286+ ᅠ300 . AutoReset = true ;
287+ ᅠ300 . Elapsed += new System . Timers . ElapsedEventHandler ( Sparta_Elapsed ) ;
288+ ᅠ300 . Start ( ) ;
289+
287290 // MainTest(args);
288291 DoProfiling ( args ) ;
289292 }
290293
294+ private static System . Timers . Timer ᅠ300 ;
295+ private static bool s_showSparta = true ;
296+
297+ private static void Sparta_Elapsed ( object sender , System . Timers . ElapsedEventArgs e )
298+ {
299+ if ( s_showSparta )
300+ System . Console . Title = "THIS IS MADNESS!!! Madness huh? THIS IS SPARTA!!!!!!! " ;
301+ else
302+ System . Console . Title = "https://github.com/ststeiger/sql_profiler" ;
303+
304+ s_showSparta ^= true ;
305+ }
306+
291307
292308 static void MainTest ( string [ ] args )
293309 {
@@ -309,9 +325,9 @@ static void MainTest(string[] args)
309325 string pw = TestPlotly . SecretManager . GetSecret < string > ( "DefaultDbPassword" ) ;
310326 ar = $ "--server { instance } --username { un } --password { pw } --db \" Redmine\" ";
311327 }
312- catch ( Exception e )
328+ catch ( System . Exception e )
313329 {
314- Console . WriteLine ( e ) ;
330+ System . Console . WriteLine ( e ) ;
315331 throw ;
316332 }
317333 }
@@ -385,15 +401,22 @@ static void DoProfiling(string[] args)
385401 // System.Console.WriteLine("--- Press ENTER to stop profiling --- ");
386402 // System.Console.ReadLine();
387403
388- System . Console . WriteLine ( "--- Press any key to stop profiling --- " ) ;
404+ // System.Console.WriteLine("--- Press any key to stop profiling --- ");
389405 // System.Console.ReadKey();
390406
391- // This is Sparta !
392- while ( ! System . Console . KeyAvailable )
393- {
394- System . Threading . Thread . Sleep ( 500 ) ;
395- }
407+ System . Console . WriteLine ( "--- Press ENTER to stop profiling --- " ) ;
408+
396409
410+ do
411+ {
412+ // THIS IS MADNESS!!! Madness huh? THIS IS SPARTA!!!!!!!
413+ while ( ! System . Console . KeyAvailable )
414+ {
415+ System . Threading . Thread . Sleep ( 100 ) ;
416+ }
417+
418+ } while ( System . Console . ReadKey ( ) . Key != System . ConsoleKey . Enter ) ;
419+
397420 OnExit ( ) ;
398421 } // End Sub Test
399422
0 commit comments