Advertisement
Fhernd

UsoSleep.cs

Sep 19th, 2014
763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement