/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System.Threading.Tasks/Task/Overview/csharp/startnew1.cs
23 строки
533 B
Genevieve Warren
Add remarks for core types (#38970)
05 янв 2024, 22:14
Не верифицирован
05 янв 2024, 22:14
71d1377
Код
Авторство
О чём код?
// <Snippet7> using System; using System.Threading.Tasks; public class Example2 { public static void Main() { Task t = Task.Factory.StartNew(() => { // Just loop. int ctr = 0; for (ctr = 0; ctr <= 1000000; ctr++) { } Console.WriteLine("Finished {0} loop iterations", ctr); }); t.Wait(); } } // The example displays the following output: // Finished 1000001 loop iterations // </Snippet7>