using System;
using System.Threading;
namespace Recetas.Multithreading.Cap01
{
public sealed class UsoSleep
{
public static void Main()
{
for (int i = 1; i <= 5; ++i)
{
Console.WriteLine ("Pausa por 2 segundos...");
// Detiene el thread por 2 segundos:
Thread.Sleep (2000); // Alternativo Thread.Sleep (TimeSpan.FromSeconds(2));
}
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGhyZWFkaW5nOwoKbmFtZXNwYWNlIFJlY2V0YXMuTXVsdGl0aHJlYWRpbmcuQ2FwMDEKewogICAgcHVibGljIHNlYWxlZCBjbGFzcyBVc29TbGVlcAogICAgewogICAgICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgICAgICB7CiAgICAgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDw9IDU7ICsraSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUgKCJQYXVzYSBwb3IgMiBzZWd1bmRvcy4uLiIpOwogICAgICAgICAgICAgICAgLy8gRGV0aWVuZSBlbCB0aHJlYWQgcG9yIDIgc2VndW5kb3M6CiAgICAgICAgICAgICAgICBUaHJlYWQuU2xlZXAgKDIwMDApOyAgICAgLy8gQWx0ZXJuYXRpdm8gVGhyZWFkLlNsZWVwIChUaW1lU3Bhbi5Gcm9tU2Vjb25kcygyKSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0=