using System; using System.Threading; public class ExempleJoin { public static void Main() { // Création d'un Thread Thread th= new Thread(new ThreadStart(CompteRebours)); // Lancer le Thread th.Start(); // Bloque le Premier Thread th th.Join(); // Exceuter la méthode CompteRebours() à partir du deuxième Thread CompteRebours(); } // Compte à Rebours de 1000 à 1 public static void CompteRebours() { for (int compteur = 1000; compteur > 0; compteur--) { Console.Write(compteur.ToString() + " "); } } } |
0