Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using System;
  2. using System.Threading;
  3.  
  4. namespace Recetas.Multithreading.Cap01
  5. {
  6.     public sealed class UsoSleep
  7.     {
  8.         public static void Main()
  9.         {
  10.             for (int i = 1; i <= 5; ++i)
  11.             {
  12.                 Console.WriteLine ("Pausa por 2 segundos...");
  13.                 // Detiene el thread por 2 segundos:
  14.                 Thread.Sleep (2000);     // Alternativo Thread.Sleep (TimeSpan.FromSeconds(2));
  15.             }
  16.         }
  17.     }
  18. }